1.8.2
Improvements
-
:proxyplugin: allow setting:no_proxyoption to"*"(or["*"]) to allow bypassing proxy for all requests. -
Extending sessions with unknown options will now raise an error, instead of silently ignoring them (consistent with the initialization case now):
session = HTTPX.with(unknown_option: 1) # will raise a HTTPX::Error: unknown option: unknown_option
-
Use
HTTP2::Connection#closed?internally (instead of state) to check for connection state; this will, in a future release ofhttp-2, seamlessly support the new:closingstate. -
Add missing
responseattribute reader toHTTPX::RequestTimeoutError. -
Improve correctness of calling dup on requests and connections.
Bugfixes
-
:authplugin: generate token first, then set the “expires_at” timestamp (bearer tokens, specially if JWT, may carry information about when it expires). -
:authplugin: do not check for token freshness on a retry, instead force token regeneration. -
:retriesplugin: do not apply “retry after” delay after a ping timeout error (the ping timeout already implies a delay, so retry on a new connection should be immediate). -
:retriesplugin: do not retry on any HTTP/2 frame error (only on GOAWAY or PING frame errors). -
:persistentplugin: do not decrement request remaining retries on ping or GOAWAY frame errors. -
:tracingplugin: set connection initialization time to nil no termination (so that it doesn’t get reused on persistent connections after reuse). -
:follow_redirectsplugin: fixed issue when a timeout error would be raised but only bubble up to the root request, not properly closing the in-flight follow up request, and leaving the request handling phase in a broken state. -
datadog adapter: the connection initialization time is now set only on connect or first request received, the reason, making it more accurate.
-
webmock adapter:
.to_timeouthelper will make the request raise aHTTPX::RequestTimeoutErrorinstead of a plainTimeoutError(otherwise, if using persistent sessions, it’d trigger a retry instead and mess with webmock request count bookkeeping). -
native resolver: do not transition to
:openif the socket was closed during resolution (which happens when an error is raised while the query bytes are buffered). -
fix for when setting a new session callback on an ssl context object which has been frozen after the first connection attempt (done by binding the ssl context callback to an internal ivar which can be changed).
-
connection: protect against
Errno::ETIMEDOUTerrors on socket close by forcing transition to closed. -
do not set a ping timer for HTTP/1.1 on keep alive flow, as there’s no ping and the connection is reestablished.