650 Commits

Author SHA1 Message Date
HoneyryderChuck
f9a6aab475 add the no-sni-with-san-check test 2023-09-08 23:29:12 +01:00
HoneyryderChuck
5ffab53364 disable http2 goaway test for jurby (ssl socket hanging on reconnection, can't figure out the reason yet) 2023-09-06 22:09:56 +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
9c831205e0 linting 2023-08-16 01:08:41 +01:00
HoneyryderChuck
a429a6af22 .digest_auth can now support prior hashed ha1 password via :hashed
kwarg

this is something common to store in htdigest files for example, and is
a format supported by webrick as well.
2023-08-16 00:35:46 +01:00
HoneyryderChuck
73484df323 add tests for -sess digest auth 2023-08-08 23:11:02 +01:00
HoneyryderChuck
9b2c8e773d faraday test fix: old faraday does not support stringio inputs 2023-08-01 10:36:54 +01:00
HoneyryderChuck
607fa42672 fix faraday test again... 2023-08-01 10:06:05 +01:00
HoneyryderChuck
0ce42ba694 use string in faraday test 2023-08-01 09:51:29 +01:00
HoneyryderChuck
93b4ac8542 added tests to faraday adapter, for timeout and proxy based features 2023-07-31 16:09:59 +01:00
HoneyryderChuck
baab52f440 lax error check 2023-07-05 23:18:29 +01:00
HoneyryderChuck
1c04bf7cdb Merge branch 'master' of gitlab.com:os85/httpx 2023-07-05 23:03:39 +01:00
HoneyryderChuck
4b058cc837 replaced endpoint used to test udp-to-tcp dns upgrade 2023-07-05 22:55:08 +01:00
HoneyryderChuck
17a26be1a9 added #bearer_auth helper in authentication pluginn 2023-07-02 22:23:07 +01:00
HoneyryderChuck
244563720a proxy plugin: fail early if proxy scheme is not supported
The error which it was appearing when erroneously using "https" in a
proxy url was too cryptic.
2023-06-26 15:54:16 +01:00
HoneyryderChuck
0397d6d814 omit ntlm tests from recent ruby test pipelines (ciphers unsupported in recent openssl default mode) 2023-06-15 15:31:39 +01:00
HoneyryderChuck
d24cf98785 add test for case when body only responds to #length 2023-06-13 17:43:00 +01:00
HoneyryderChuck
896253bcbc testing response cache internal store 2023-06-13 17:34:57 +01:00
HoneyryderChuck
32188352a5 test jitter with retries plugin 2023-06-13 17:13:51 +01:00
HoneyryderChuck
b9b2715b10 improve coverage of altsvc and resolver modules 2023-06-13 16:54:19 +01:00
HoneyryderChuck
0555132740 integrate mutex_m in signatures 2023-06-12 20:42:57 +01:00
HoneyryderChuck
9342f983d5 improved coverage of response_cache plugin
and fixed a bug in the process
2023-06-12 20:42:57 +01:00
HoneyryderChuck
eb0291ed87 :circuit_breaker plugin: added support for .on_circuit_open callback
called when a circuit is open.

```ruby
HTTPX.plugin(:circuit_breaker).on_circuit_open do |req|
  # ... do smth
end
2023-06-12 20:42:57 +01:00
HoneyryderChuck
f066bc534f fixed Response::Body#read test, which didn't really test for equality, and was therefore broken 2023-06-08 23:24:34 +01:00
HoneyryderChuck
0d969a7a3c errors in response chunk handling will now bubble up and force the connection to close 2023-05-31 20:17:27 +01:00
HoneyryderChuck
0f988e3e9f adding session lifecycle callbacks 2023-05-31 20:06:59 +01:00
HoneyryderChuck
9bcae578d7 recover from errors on response chunk processing
first attempt at more granular error handling: during response chunk processing, errors will be handled in a way where current response stops being fetched; for http/1, the connection is fully reset, for http/2, the individual stream is cancelled
2023-05-31 11:24:21 +01:00
HoneyryderChuck
5655c602c7 the oauth plugin 2023-05-25 16:45:25 +01:00
HoneyryderChuck
af38476a14 test for oauth plugin 2023-05-25 16:37:22 +01:00
HoneyryderChuck
ddffe33bcd removing ruby 2.3 from CI 2023-05-22 01:58:02 +02:00
HoneyryderChuck
f193e164ff cleaning up resolver test artifacts 2023-05-22 01:09:40 +02:00
HoneyryderChuck
1433f35186 moar tests for native resolver paths 2023-05-22 00:42:52 +02:00
HoneyryderChuck
1fb4046d52 added test exercising the dns error path 2023-05-21 23:45:38 +02:00
HoneyryderChuck
bd233c5303 effort to increase coverage of tests 2023-04-28 23:57:25 +01:00
HoneyryderChuck
5f079f8fc0 downgrading to webmock 3.18.0
Identifying an issue when running datadog and webmock in tandem, and
running webmock 3.18.1.
2023-04-28 11:23:43 +01:00
HoneyryderChuck
899b2df94f only test integrations with latest ruby, some telemetry stuff firing from the datadog sdk... 2023-04-27 23:47:55 +01:00
HoneyryderChuck
bbf257477b Removing HTTPX::Registry and its usage internally
These internnal registries were a bit magical to use, difficult to
debug, not thread-safe, and overall a nuisance when it came to type
checking. So long.
2023-04-27 22:49:20 +01:00
HoneyryderChuck
6aacc9b0eb native resolver falls back to tcp dns when receiving truncated packet
yet another compliance fix for the DNS protocol; while udp is the
preferred transport, in case a truncated response is received, the
resolver will switch to tcp, and performm the DNS query again.

This introduces a new resolver option, `:socket_type`, which is `:udp`
by default.
2023-04-25 22:46:54 +01:00
HoneyryderChuck
5bba381bb8 added test for resolving a domain which results in a large/truncated UDP response packet 2023-04-25 22:46:54 +01:00
HoneyryderChuck
62a241b22e fix CI ruby 2.3 build which could not download iptables package 2023-04-25 22:34: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
673d210fd8 fix tests not being adjusted 2023-04-18 02:34:11 +03:00
HoneyryderChuck
ee4caa552b bugfix: digest auth enabled session wasn't working if session did not have digest credentials setup yet 2023-04-18 02:08:21 +03:00
HoneyryderChuck
ba21f83827 improve coverage of cookie and aws authentication tests 2023-04-18 02:06:47 +03:00
HoneyryderChuck
8105e1128e introduce :buffer_size option
this allows to tweak connection buffer sizes, which may help optimizing
memory usage, and in this case, test the resumable retries.

wip
2023-04-17 18:09:24 +03:00
HoneyryderChuck
cb523794d7 retries: allow for resuming requests using ranges
a new feature is introduced in the `retries` plugin, whereas if an error
occurred midway response payload transfer, and the peer server signaled
(via `"accept-ranges"`) that accepts range requests, the retried request
will attempt to start over from where the previous request left off.
2023-04-17 17:19:41 +03: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
ea61cce815 print ruby version in tests 2023-03-29 00:12:19 +01:00