1111 Commits

Author SHA1 Message Date
HoneyryderChuck
4cec75c33a bumped version to 0.18.7 2022-01-12 10:54:08 +02:00
HoneyryderChuck
a03a66eb63 fix filemagic: rewind file after mime type detection 2022-01-12 10:52:32 +02:00
HoneyryderChuck
f99abc38e2 Merge branch 'fix-filemagic' 2022-01-12 10:11:50 +02:00
HoneyryderChuck
561b7da590 bumped version to 0.18.6 2022-01-12 10:10:32 +02:00
HoneyryderChuck
e7f11604f5 added missing constant to multipart filemagic integration 2022-01-12 10:07:44 +02:00
HoneyryderChuck
22d18cecdd fixing env proxy again: options class must be looked up, as the default one was somehow cached 2022-01-08 17:48:52 +02:00
HoneyryderChuck
764ec71a4f native resolver: do not leave timeouts for alreaady resolved hosts around, affects subsequent 2022-01-08 15:22:32 +02:00
HoneyryderChuck
5c019c440f added test for testing the env var proxy defs 2022-01-08 15:09:11 +02:00
HoneyryderChuck
7da23ac89c enable connection coalescing for proxied connections 2022-01-08 15:09:11 +02:00
HoneyryderChuck
fde8ea3276 fix: do not apply timeout errors on inactive conns
when selector emits a timeout error, the full list of connections in the
pool is traversed. This is in itself not very performant, but the
problem is that the accounting is also done with connection which
weren't selected, such as the inactive connections. So we skip this for
them for now.
2022-01-07 12:26:26 +02:00
HoneyryderChuck
9aeaf437ef fix: proxy plugin #next_proxy returns a proxy options hash instead
the #next_proxy function was relying on the existence of a proxy object.
However, in the case of default proxy plugin, this is not the case, and
this is only created later.
2022-01-07 12:26:26 +02:00
HoneyryderChuck
48be2bd13a fix: proxy plugin loaad on http(s)_proxy envvar is working
the grep call was applied on an hash, instead of the keys, and was
therefore not picking up the proxy plugin when it should.
2022-01-07 12:26:26 +02:00
HoneyryderChuck
d3b36c5668 added support for HTTP/2 proxy by simplifying the overall http proxy implementation 2022-01-07 12:26:26 +02:00
HoneyryderChuck
1343c74e31 fixing overwriting connection #transition, which wasn't taking tcp connect on proxy errors 2022-01-07 12:26:26 +02:00
HoneyryderChuck
0e9823158a bumped version to 0.18.5 2022-01-02 23:31:43 +02:00
HoneyryderChuck
8dec7ed093 Merge branch 'ruby-3.1' into 'master'
adding ruby 3.1 to CI

See merge request honeyryderchuck/httpx!187
2022-01-02 20:55:03 +00:00
HoneyryderChuck
c7ee489c78 Merge branch 'issue-176' into 'master'
fix: HTTP/1.1 pipeline disable out of consumption loop

Closes #176

See merge request honeyryderchuck/httpx!185
2022-01-02 20:36:45 +00:00
HoneyryderChuck
0fcb55d502 fixed origin uri handling, to make it still quack like a URI::HTTP on uri 0.11 2022-01-02 22:32:54 +02:00
HoneyryderChuck
9596f5a5e1 fix: use passed host header as authority for HTTP/2
"host" header is considered an invalid HTTP/2 header, and I think that,
although we log it, the parser does not send it. However, this is
equivalent to a silent fail. We'll be then copying cURL's behaviour,
i.e. use the user-set "host" as ":authority", but we'll be logging this
behaviour, in case it changes in the future.

Fixes #177
2021-12-31 18:13:59 +02:00
HoneyryderChuck
be4bdb3cf5 fix: HTTP/1.1 pipeline disable out of consumption loop
pipeline disabling may happen on the `handle_error` phase outside of the
main consumption loop, so the `throw` call is out of context, and needs
to be guarded against. we're alreaady doing in the handler, so I'm just
quick-fixing it fow now.

Fixes #176
2021-12-31 17:54:44 +02:00
HoneyryderChuck
87bb4a4994 bumped to 0.18.4 2021-12-27 01:40:05 +02:00
HoneyryderChuck
d4bc21d65c alt-svc: yield alt origin as either http or https url, pass proto as an option 2021-12-27 01:14:33 +02:00
HoneyryderChuck
f56619efba fix: support webmock retries / response sequences
The previous implementation of the webmock plugin bypassed the
connection layer, which made it ignore key plugins like the retries
plugin. The whole plugin was redone so that it'd hook at the connection
level when piping requests.

A small difficulty was on how to handle the connection initialization
state when needing to unmock, as name resolving triggers before requests
are piped. A hack with a #once callback was implemented.

Fixes #170
2021-12-26 23:52:10 +02:00
HoneyryderChuck
3b882f59d6 Merge branch 'issue-171' into 'master'
fix: remove mime-types support for mime type file detection

Closes #171

See merge request honeyryderchuck/httpx!180
2021-12-24 11:42:39 +00:00
HoneyryderChuck
dea70478ea faraday: added support for #on_data 2021-12-22 16:01:48 +02:00
HoneyryderChuck
be5300ea4a fix: remove mime-types support for mime type file detection
mime-types uses filenames, which is a terrible and inaccurate strategy
to infer mime types (example: "a.mp4" can be "application/mp4" or
"audio/mp4" before it's "video/mp4").

Added support for `marcel` and `filemagic`, which both support magic
bytes detection strategy.

Fixes #171
2021-12-18 00:47:19 +00:00
HoneyryderChuck
17b3b6c1d1 bumped version to 0.18.3 2021-12-14 20:19:20 +00:00
HoneyryderChuck
c8d32b7363 fix: request bodies eager-loaded from enumerables yield duped partial
strings

An error was observed while looking at webmock integration, where
requests formed via the multipart plugin where returning an empty string
as body. The issue was caused by an optimization on multipart encoder,
which reuses the same buffer when reading chunks. Unfortunately, these
cannot be yielded the same way via IO.copy_stream, as the same (cleared)
buffer will be used to generate the eager-loaded body chunks.
2021-12-14 19:12:58 +00:00
HoneyryderChuck
facffe7644 bumped version to 0.18.2 2021-12-09 17:53:41 +00:00
HoneyryderChuck
edc2c4e6c4 do not loop forever if there are no connections to listen nor any timer
to wait for.

Timeout calculation may trigger errors which lead to connection
unregistering, such as tital timeout errors. In such a case, we can end
up in a state where #select gets called with no timeout and no
selectable connections.

https://github.com/HoneyryderChuck/httpx/issues/3
2021-12-09 15:02:32 +00:00
HoneyryderChuck
8e77f0464a bumping version to 0.18.1 2021-11-23 10:32:12 +00:00
HoneyryderChuck
ab70f6a586 total timeout call should bubble up exception, not timeout value 2021-11-19 23:03:08 +00:00
HoneyryderChuck
f3cff86775 cleaning up state within an http2 connection receiving a goaway, to properly mark it to be close; this will prevent unfinished pending requests to fall in the same connection, resulting in an unrecoverable internal state error 2021-11-19 16:24:50 +00:00
HoneyryderChuck
0f80baf351 retries plugin: make errorless http2 connnection goaway a retryable error 2021-11-18 18:12:32 +00: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
c7d73d09b8 coalescing: do not try to use a self-signed certificate for coalescing verification purposes 2021-11-17 21:35:31 +00:00
HoneyryderChuck
72924e420b fixing HTTP/1 logging on pipelining, where the buffered requests would appear in the second request log 2021-11-14 02:56:32 +00:00
HoneyryderChuck
b18b715818 some small rbs improvemments 2021-11-13 11:09:29 +00:00
HoneyryderChuck
8a8e0998df bumping version to 0.18.0 2021-10-02 23:53:07 +01:00
HoneyryderChuck
b2a5371fe2 fix missing var 2021-10-02 00:27:37 +01:00
HoneyryderChuck
a3ee98f410 implementation of the response cache plugin 2021-10-01 23:53:21 +01:00
HoneyryderChuck
a60fde07d6 added plugin tests, and the plugin body 2021-10-01 23:38:38 +01:00
HoneyryderChuck
bdcd4b31b5 aws_sdk plugin: removing S3 plugin APIs, replacing it with barebones aws-sdk-core components 2021-10-01 23:20:19 +01:00
HoneyryderChuck
8f5c45225b removing aws-sdk-s3 constraint in sigv4 plugin (does not require anything aws-sdk related) 2021-10-01 23:20:19 +01:00
HoneyryderChuck
1e4177a079 allow connections to be closed before they even started, if some error coming from the parser requires it (can happen if user input is evaluated in httpx time and fails) 2021-09-27 16:18:02 +01:00
HoneyryderChuck
eb5bdc1fe6 telemetry: fixed visibility of #close; more log data 2021-09-27 16:18:02 +01:00
HoneyryderChuck
207ecb2da0 bugfix: making https resolver subscribe to the right pool
(such as when it's overwritten, such as in the case of SessionWithPool Module)
2021-09-27 16:18:02 +01:00
HoneyryderChuck
efddd72caa removing persistent connections from the selector whe inactive
keeping them around was resulting in some busy loops on timer events
(i.e. retry after), making them unreliable, innacurate  and CPU
draining. they're now kept out whenever they're inactive.
2021-09-27 16:18:02 +01:00
HoneyryderChuck
52948e0f83 bugfix: prevent stream close callback from being called 2 times
an issue was observed when stream was closed from our side, that the
the request in-flight count on the connection. This was fixed by not
reacting to :stream_closed events if request has been previously deleted.
2021-09-23 12:12:48 +01:00
HoneyryderChuck
81a41d889c bugfix: remove connections from selector which have been unregistered
during interest calculation

A quirk was found whereby a connection which failed while connecting
(such as the badssl test) was properly unregistered from the pool, was
however kept in the selectables selector pool, because if this operation
happening during the interest calculation pool, and the var substitution
being performed right afterwards, leaving the pool and selector out of
sync and causing all sorts of miscalculations around timers later on.
2021-09-22 12:53:33 +01:00