81 Commits

Author SHA1 Message Date
HoneyryderChuck
095fbb3463 using local aws for the max requests tests
reduce exposure to httpbin.org even more
2025-08-07 12:12:50 +01:00
HoneyryderChuck
7790589c1f linting issue 2025-08-07 11:28:18 +01:00
HoneyryderChuck
dd8608ec3b small improv in max requests tests to make it tolerant to multi-homed networks 2025-08-07 11:22:29 +01:00
HoneyryderChuck
17c1090b7a more agressive timeouts in tests 2025-04-26 00:10:48 +01:00
HoneyryderChuck
c626fae3da adding test to force usage of max_requests conditionals under http1 2025-04-13 01:05:08 +01:00
HoneyryderChuck
51b2693842 Merge branch 'gh-disc-71' into 'master'
:stream_bidi plugin

See merge request os85/httpx!365
2025-04-04 09:51:29 +00:00
HoneyryderChuck
84db0072fb new :stream_bidi plugin
this plugin is an HTTP/2 only plugin which enables bidirectional streaming

the client can continue writing request streams as response streams arrive midway

Closes https://github.com/HoneyryderChuck/httpx/discussions/71
2025-04-04 00:21:12 +01:00
HoneyryderChuck
1f59688791 rename test servlet 2025-04-04 00:18:53 +01:00
HoneyryderChuck
5917c63a70 add more error message context to settings timeout flaky test 2025-03-19 23:41:02 +00:00
HoneyryderChuck
a437de36e8 handle HTTP_1_1_REQUIRED stream GOAWAY error code by retrying on new HTTP/1.1 connection
it was previously only handling 421 status codes for the same effect; this achieves parity with the frame-driven redirection
2025-03-19 23:11:51 +00:00
HoneyryderChuck
bf9d847516 moved xml encoding/decoding + APIs into :xml plugin 2024-12-08 12:48:47 +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
David Roetzel
95c1a264ee Add support for content-digest headers (RFC9530)
Closes #323
2024-12-02 12:37:40 +00:00
HoneyryderChuck
79d5d16c1b moving session with pool test plugin to override on the session and drop pool changes 2024-11-19 12:55:44 +00:00
HoneyryderChuck
c7431f1b19 ssrf filter plugin
a plugin which allows for requests to fail when requests are crafted to
use IPs considered internal or reserved for specific usages. these SSRF
vulnerabilities happen when one allows requests with urls input by an
external user.

This plugin is inspired, and heavily makes use of routines existing in
the ssrf_filter gem: https://github.com/arkadiyt/ssrf_filter/ .
2023-11-17 23:40:01 +00:00
HoneyryderChuck
1cc9d4f04b fixing recovering from exhausted connections for HTTP/1
this has been working for a while, but was silently failing in HTTP/1, due to our inability to test it in CI (HTTP/1 setup is not yet using keep-alive)
2023-10-24 22:53:22 +01:00
HoneyryderChuck
ca75148e86 http/2: do not interpret MAX_CONCURRENT_STREAMS as request cap
a misinterpretation of the spec on http-2-next led to the introduction
of the max_requests option, a cap of requests on a given connection,
which in http/2 case, would be initialized with MAX_CONCURRENT_STREAMS,
which means something else.

This has been fixed already in http-2-next, and this is the summary of
changes required to support it.

The `max_requests` option is kept, as it can still be useful from a user
perspective, but the default in http/2 is now INFINITY, which disables
it effectively. The HTTP/1 cap is bumped to 200, but it may fall as
well soon.
2023-10-13 15:56:10 +01:00
HoneyryderChuck
085cec0c8e improve coverage and simplified faraday adapter
and some other modules
2023-09-20 17:57:41 +01:00
HoneyryderChuck
e88956a16f improving coverage of tests for proxy module 2023-09-20 17:57:41 +01:00
HoneyryderChuck
0d58408c58 compression plugins for gzip and deflate supported by default
most of the code was moved to the transcoder layer.

The `compression_threshold_size` option has been removed.

The `:compression/brotli` plugin becomes only ´:brotli`, and depends on
the new transcoding APIs.

options to skip compression and decompression were added.
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
f9a6aab475 add the no-sni-with-san-check test 2023-09-08 23:29:12 +01:00
HoneyryderChuck
487a747544 allow reuse of previously closed connections within the scope of a session
when closed, connections are now placed in a place called eden_connections; whenever a connection is matched for, after checking the live connections and finding none, a match is looked in eden connections; the match is accepted **if** the IP is considered fresh (the input is validated in the cache, or input was an ip or in /etc/hosts, or it's an external socket) and, if a TLS connection, the stored TLS session did not expire; if these conditions do not match, the connection is dropped from the eden and a new connection will started instead; this will therefore allow reusing ruby objects, reusing TLS sessions, and still respect the DNs cache
2023-09-06 22:09:56 +01:00
HoneyryderChuck
ef2f0cc998 ssl: support session resumption on reconnections with same session
when connections get reset due to max number of requests being reached,
the same TLS session is going to be reused, as long as it's valid.

This change is ported from the same feature in net-http, including [the
tls 1.3
improvements](ddf5c52b5f)
2023-09-06 22:09:56 +01:00
HoneyryderChuck
0f988e3e9f adding session lifecycle callbacks 2023-05-31 20:06:59 +01:00
HoneyryderChuck
af38476a14 test for oauth plugin 2023-05-25 16:37:22 +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
df26c97e38 changed http based tests, added #scheme, using it to correctly set no proxy domain 2023-03-29 23:00:50 +01:00
HoneyryderChuck
eb3d3f9048 implementation of the webdav plugin 2022-08-13 15:30:37 +01:00
HoneyryderChuck
c31ded54e1 circuit breaker plugin 2022-08-07 22:24:57 +01:00
HoneyryderChuck
a316b31e7d fix: SNI is now disabled when the URL host is an IP 2022-05-07 18:17:47 +01:00
HoneyryderChuck
5307b33cb6 more timmeout leeway, using Thread.kill instead (truffleruby tests) 2022-03-29 22:55:01 +01:00
HoneyryderChuck
e9a81d6b16 enabled h2 tests which were blocked for jruby 2022-03-05 17:33:37 +00:00
HoneyryderChuck
91a106db54 log test improvements: test with higher level, test tty and non-tty 2022-01-16 02:29:38 +02:00
HoneyryderChuck
5a61586fd5 do not ignore goaway with no errors sent by the server, let the connection go down
raise a specific error for this, which will make it easier to rescue
from.
2021-11-18 18:07:12 +00:00
HoneyryderChuck
f31b06c150 improving servlet layer to be able to quickly build an HTTP2 test server 2021-11-17 21:34:16 +00:00
HoneyryderChuck
a60fde07d6 added plugin tests, and the plugin body 2021-10-01 23:38:38 +01:00
HoneyryderChuck
13e865e488 hiding monotonic time funcs under the utils API 2021-09-20 16:16:20 +01:00
HoneyryderChuck
c95e926886 auto-corrected the easy ones first 2021-09-03 12:24:18 +01:00
HoneyryderChuck
a0ac3354dc disabling grpc for truffleruby 2021-05-31 13:55:18 +01:00
HoneyryderChuck
77c86c0c22 added test to check whether client times out on settings 2021-05-29 22:53:14 +01:00
HoneyryderChuck
ff5ed7be59 added support for TLS channel credentials 2021-05-20 00:59:14 +01:00
HoneyryderChuck
7a60346bf7 Added trailer header support for writing requests
Request can also add their own trailer headers, either explicitly via
Request#trailers , or via request lifecycle callbacks
2021-05-06 10:38:20 +01:00
HoneyryderChuck
00faafddc9 added tests around the tcp connect errors 2021-03-11 17:58:24 +00:00
HoneyryderChuck
a03e93e531 allow for oportunistic upgrades, such as the apache Upgrade: h2
this is achieved by a rework of the upgrade plugin, and the addition of
an h2 upgrade plugin. The idea is the following: if a response carries
an Upgrade header, and there's a handler for it, we should go for it.
The difference is:

* when the response is 101, this means that the negotiation must take
  place before the actual response comes in;
* when the response is 200, upgrading means reconnecting to the channel,
  and assume the new protocol for subsequent requests only.
2021-03-05 12:23:17 +00:00
HoneyryderChuck
463dad46cb added the aws signature on top of the aws-sigv4 plugin, with support for using aws-sdk-core ready-made config 2021-02-02 18:33:24 +00:00
HoneyryderChuck
2866b78572 error message for sni is actually different, and I'm not sure how wasn't this being skipped 2021-01-31 15:51:34 +00:00
HoneyryderChuck
2ecfde95d8 fixing cerfificate hostname validation callback 2021-01-31 15:51:34 +00:00