2596 Commits

Author SHA1 Message Date
HoneyryderChuck
17003840d3 adding support for ruby 3.4 2025-01-02 23:38:51 +00:00
HoneyryderChuck
999d86ae3e bump version to 1.4.0 v1.4.0 2024-12-18 13:22:09 +00:00
HoneyryderChuck
a4c2fb92e7 improving coverage of modules 2024-12-18 11:10:04 +00:00
HoneyryderChuck
66d3a9e00d Merge branch 'improvs' 2024-12-10 15:09:22 +00:00
HoneyryderChuck
e418783ea9 more sig completeness 2024-12-10 15:09:00 +00:00
HoneyryderChuck
36ddd84c85 improve code around consuming request bodies (particularly body_encoder interface) 2024-12-10 15:09:00 +00:00
HoneyryderChuck
f7a5b3ae90 define selector_store sigs 2024-12-10 15:09:00 +00:00
HoneyryderChuck
3afe853517 make #early_resolve return a boolean, instead of undefined across implementations 2024-12-10 15:09:00 +00:00
HoneyryderChuck
853ebd5e36 improve coverage, eliminate dead code 2024-12-10 15:09:00 +00:00
HoneyryderChuck
f820b8cfcb Merge branch 'issue-325' into 'master'
XML plugin

Closes #325

See merge request os85/httpx!358
2024-12-08 13:14:43 +00:00
HoneyryderChuck
062fd5a7f4 reinstate and deprecate HTTPX::Response#xml method 2024-12-08 12:48:47 +00:00
HoneyryderChuck
70bf874f4a adding gem collection
includes nokogiri type sigs
2024-12-08 12:48:47 +00:00
HoneyryderChuck
bf9d847516 moved xml encoding/decoding + APIs into :xml plugin 2024-12-08 12:48:47 +00:00
HoneyryderChuck
d45cae096b fix: do not raise things which are not exceptions
this is a regression from a ractor compatibility commit, which ensured that errors raised while preparing the request / resolving name are caught and raised, but introduced a regression when name resolution retrieves a cached IP; this error only manifested in dual-stack situations, which can't be tested in CI yet

Closes #329
2024-12-07 20:00:40 +00:00
HoneyryderChuck
717b932e01 improved coverage of content digest plugin tests 2024-12-03 09:00:11 +00:00
HoneyryderChuck
da11cb320c Merge branch 'json-suffix' into 'master'
Accept more MIME types with json suffix

Closes #326

See merge request os85/httpx!357
2024-12-03 08:50:07 +00:00
sarna
4bf07e75ac Accept more MIME types with json suffix
Fixes #326 #327
2024-12-03 08:50:07 +00: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
HoneyryderChuck
ac809d18cc content-digest: set validate_content_digest default to false; do not try to compute content-digest for requests with no body 2024-12-02 13:04:57 +00:00
HoneyryderChuck
85019e5493 Merge branch 'content_digest' into 'master'
Add support for `content-digest` headers (RFC9530)

See merge request os85/httpx!354
2024-12-02 12:37:40 +00:00
David Roetzel
95c1a264ee Add support for content-digest headers (RFC9530)
Closes #323
2024-12-02 12:37:40 +00:00
HoneyryderChuck
32313ef02e Merge branch 'fix-json-encode-with-oj' into 'master'
Fix incorrect hash key rendering with Oj JSON encoder

Closes #324

See merge request os85/httpx!356
2024-11-29 19:41:40 +00:00
Denis Sadomowski
ed9df06b38 fix rubocop offenses 2024-11-29 18:26:39 +01:00
Denis Sadomowski
b9086f37cf Compat mode for Oj.dump by default 2024-11-29 17:47:30 +01:00
Denis Sadomowski
d3ed551203 revert arguments to json_dump 2024-11-29 17:40:32 +01:00
Denis Sadomowski
1b0e9b49ef Fix incorrect hash key rendering with Oj JSON encoder 2024-11-28 16:19:17 +01:00
HoneyryderChuck
8797434ae7 Merge branch 'fix-hexdigest-on-compressed-bodies' into 'master'
aws sigv4support calculation of hexdigest on top of compressed bodies in correct way

See merge request os85/httpx!355
2024-11-27 18:06:39 +00:00
HoneyryderChuck
25c87f3b96 fix: do not try to rewind on bodies which respond to #each
also, error when trying to calculate hexdigest on endless bodies
2024-11-27 17:39:20 +00:00
HoneyryderChuck
26c63a43e0 aws sigv4support calculation of hexdigest on top of compressed bodies in a more optimal way
before, compressed bodies were yielding chunks and buffering locally (the  variant in this snippet); they were also failing to rewind, due to lack of method (fixed in the last commit); in this change, support is added for bodies which can read and rewind (but do not map to a local path via ), such as compressed bodies, which at this point haven't been yet buffered; the procedure is then to buffer the compressed body into a tempfile, calculate the hexdigest then rewind the body and move on
2024-11-27 08:55:23 +00:00
HoneyryderChuck
3217fc03f8 allow deflater bodies to rewind 2024-11-27 08:50:57 +00:00
HoneyryderChuck
b7b63c4460 removing unused bits 2024-11-27 08:50:26 +00:00
HoneyryderChuck
7d8388af28 add test for calculation of hexdigest on top of a compressed body 2024-11-27 08:49:57 +00:00
HoneyryderChuck
a53d7f1e01 raise error happening in request-to-connection paths
but only when the selector is empty, as there'll be nothing to select on, and this would fall into an infinite loop
2024-11-19 12:55:44 +00:00
HoneyryderChuck
c019f1b3a7 removing usage of global unshareable object in default options 2024-11-19 12:55:44 +00:00
HoneyryderChuck
594f6056da native resolver: treat tcp hanshake errors as resolve errors 2024-11-19 12:55:44 +00:00
HoneyryderChuck
113e9fd4ef moving leftover option proc into private function 2024-11-19 12:55:44 +00:00
HoneyryderChuck
e32d226151 refactor of internal resolver cache lookup access to make it a bit safer 2024-11-19 12:55:44 +00:00
HoneyryderChuck
a3246e506d freezing all default options 2024-11-19 12:55:44 +00:00
HoneyryderChuck
ccb22827a2 using find_index/delete_at instead of find/delete 2024-11-19 12:55:44 +00:00
HoneyryderChuck
94e154261b store selectors in thread-local variables
instead of fiber-local storage; this allows that under fiber-scheduler based engines, like async, requests on the same session with an open selector will reuse the later, thereby ensuring connection reuse within the same thread

in normal conditions, that'll happen only if the user uses a session object and uses HTTPX::Session#wrap to keep the context open; it'll also work OTTB when using sessions with the  plugin. Otherwise, a new connection will be opened per fiber
2024-11-19 12:55:44 +00:00
HoneyryderChuck
c23561f80c linting... 2024-11-19 12:55:44 +00:00
HoneyryderChuck
681650e9a6 fixed long-standing reenqueue of request in the pending list 2024-11-19 12:55:44 +00:00
HoneyryderChuck
31f0543da2 minor improvement on handling do_init_connection 2024-11-19 12:55:44 +00:00
HoneyryderChuck
5e3daadf9c changing the order of operations handling misdirectedd requests
because you're reconnecting to the same host, now the previous connection is closed, in order to avoid a deadlock on the pool where the per-host conns are exhausted, and the new connection can't be initiated because the older one hasn't been checked back in
2024-11-19 12:55:44 +00: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
1f9dcfb353 implement per-origin connection threshold per pool
defaulting to unbounded, in order to preserve current behaviour; this will cap the number of connections initiated for a given origin for a pool, which if not shared, will be per-origin; this will include connections from separate option profiles

a pool timeout is defined to checkout a connection when limit is reeached
2024-11-19 12:55:44 +00:00
HoneyryderChuck
d77e97d31d repositioned empty placeholder hash 2024-11-19 12:55:44 +00:00
HoneyryderChuck
69e7e533de synchronize access to connections in the pool
also fixed the coalescing case where the connection may come from the pool, and should therefore be remmoved from there and selected/checked back in accordingly as a result
2024-11-19 12:55:44 +00:00
HoneyryderChuck
840bb55ab3 do not return idle (result of either cloning or coalescing) connections back to the pool 2024-11-19 12:55:44 +00:00
HoneyryderChuck
5223d51475 setting the connection pool locally to the session
allowing it to be plugin extended via pool_class and PoolMethods
2024-11-19 12:55:44 +00:00