20 Commits

Author SHA1 Message Date
HoneyryderChuck
42d42a92b4 added missing test for close_on_fork option 2025-04-09 09:39:53 +01:00
HoneyryderChuck
3b52ef3c09 Merge branch 'simpler-selector' into 'master'
:pool option + thread-safe session-owned conn pool

See merge request os85/httpx!348
2024-12-02 14:26:17 +00:00
Denis Sadomowski
1b0e9b49ef Fix incorrect hash key rendering with Oj JSON encoder 2024-11-28 16:19:17 +01:00
HoneyryderChuck
6b9a737756 introducing Connection#peer to point to the host to connect to
this eliminates the overuse of Connection#origin, which in the case of proxied connections was broken in the previous commit

the proxy implementation got simpler, despite this large changeset
2024-11-19 12:55:44 +00:00
HoneyryderChuck
4a351bc095 adapted plugins to the new structure 2024-11-19 12:55:44 +00:00
HoneyryderChuck
8b2ee0b466 remove form, json, ,xml and body from the Options class
Options become a bunch of session and connection level parameters, and requests do not need to maintain a separate Options object when they contain a body anymore, instead, objects is shared with the session, while request-only parameters get passed downwards to the request and its body. This reduces allocations of Options, currently the heaviest object to manage.
2024-06-11 18:23:45 +01:00
HoneyryderChuck
9d03dab83d missing require for uri lib 2024-05-02 17:22:29 +01:00
HoneyryderChuck
dc7b41e7da test reproducing ssl error blocking clean connection exit 2024-01-13 00:20:52 +00:00
HoneyryderChuck
dd84195db6 bump coverage by testing more edge cases
mime type detector using file, no idnx
2023-09-27 11:59:52 +01:00
HoneyryderChuck
d55bfec80c fix: system resolv timeout raise ResolveTimeoutError instead of ResolveError 2023-09-20 17:57:41 +01:00
HoneyryderChuck
3f73d2e3ce multipart supported by default
the plugin was now moved to the transcoder layer, where it is available
from the get-go.
2023-09-20 17:57:41 +01:00
HoneyryderChuck
477c3601fc eliminated blocks testing for ruby < 2.7 2023-09-20 17:57:05 +01:00
HoneyryderChuck
a3add3c721 Merge branch 'fix-no-proxy' into 'master'
fix proxy discovery using proxy env vars

See merge request os85/httpx!242
2023-04-24 10:35:47 +00:00
HoneyryderChuck
092e594a4b Request.verb is now an upcased string (ex: "GET")
The reference for a request verb is now the string which is used
everywhere else, instead of the symbol corresponding to it. This was an
artifact from the import from httprb, and there is no advantage in it,
since these strings are frozen in most use cases, and the
transformations from symbol to strings being performed everywhere are
prooof that keeping the atom isn't really bringing any benefit.
2023-04-17 16:54:31 +03:00
HoneyryderChuck
cbd695fb9c fix proxy discovery using proxy env vars
connections weren't being correctly initiated, as proxies were filtered
for the whole session based on URI.find_proxy for the first call. This
fixes it by:

* applying it to all used uris;
* falling back to proxy options instead;
* apply no_proxy option in case it's used, using
  `URI::Generic.use_proxy?
2023-03-30 22:08:32 +01:00
HoneyryderChuck
25b949cf66 Added support for multiple JSON parsers
When available, httpx will either use `multi_json`, `oj`, or `yajl`,
before it falls back to default `json`.
2022-08-05 22:57:06 +01:00
HoneyryderChuck
1cf8c68ac6 fix: do not subclass session class to make it play along with default
class overrides

the faraday adapter was relying on subclassing the session to load
custom plugins. this doesn't play well with other integrations
monkeypatching the original session class, such as datadog or webmock,
which redefine it. from now on, we not only defer the creation of the
custom until necessary, we also use Session#plugin

Fixes #187
2022-04-04 12:54:33 +01:00
HoneyryderChuck
f5fcc24aa6 env proxy: added test for connnection reuse 2022-01-15 01:38:14 +02:00
HoneyryderChuck
317ed07dba added tests for all supported mime type detectors 2022-01-12 15:50:44 +02:00
HoneyryderChuck
b700a4f994 bootstrapping standalone tests, test which need to run in full-isolation mode (own process), where proxy intgration via env var is tested 2022-01-12 01:43:08 +02:00