1_6_3.md

doc/release_notes/1_6_3.md

1.6.3

Features

  • allow redacting only headers, or only the body, when using debug_redact: :headers or debug_redact: :body respectively.

Improvements

  • system resolver now works in a non-blocking manner, initiating the dns query in a separate thread and waiting on the pipe after that (it was blocking the main thread during resolution before).

  • reduce allocation to a sinfle shared option object when headers are passed as a session-level option, like HTTPX.with(headers: geaders).get(...)

  • privilege using String#replace in buffer operations (instead of “clean-then-append”).

  • using Array#unshift instead of Array#concat in order to ensure that request ordering is respected in the face of an in-between error which requires reconnect-and-resend.

  • replaced more internal callback indirection with plain method calls.

Bugfixes

  • https: prevent modification of the ssl context object when performing a reconnection.

  • compression: do not return early if the decompression buffer yields an empty string (more frequent under jruby 10).

  • response cache: take query params into account when caching or retrieving cached responses.

  • response cache: do not decompress cached responses on body consumption (the response bodies are cached in plaintext).

  • native resolver: pick next timeout associated with the hostname being resolved (and not the hostnames in the queue).

  • pool: assume that, even when signalled that a connection is available, context may be switched to a session which also checks the same connection out, before it’s able to pick it up; in such a case, start from the beginning, until the pool timeout expires.

  • session: forego bookkeeping when a connection is coalesced (instead, allow it to be dropped).

  • digest_auth: make sure that an array is sent back if the probe response fails.

  • alt-svc: when alt-svc handshake happens with more in-flight requests, defer termination to when these requests are made.

  • http2: fix use of unexisting var ex when processing the connection closed callback.

  • connection: fix potential session dereferencing, which allowed connections to be used across sessions, therefore bypassing needed synchronization and leading to the undefined method 'after' for nil:NilClass error.

  • selector: close only selected connections (instead of all selectable connections) when an error occurs during IO readiness wait calls.

  • resolvers: correctly propagate abrupt termination errors to the connection objects waiting for the answer.

  • resolvers: when errors happenm force-close unresolved connections (and ensure they’re both pinned to the corresponding session before the error happens, and are unpinned after error is propagated).

  • resolvers: ensure resolvers transition to “closed” state, on all cases, when any error happens.

  • resolvers: ensure that the next hostname is resolved when a timeout happens on the current one.

  • native resolver: fixed duplication of the hostname to resolve in the list of candidates.

  • https resolver: use a system resolver to resolve the DoH server hostname (instead of rerouting it to itself).

  • https resolver: skip loop error reporting when error happens outside of it.

  • https resolver: close connection on resolve errors, which prevents it from being around in the pool after termination; also deactivate it after successful use.

  • multi resolver: do not check resolvers back into the pool if it’s a multi resolver and the peer is still resolving (and do the check outside of the critical area).

  • sentry adapter: removed usage of deprecated method which has been removed in sentry-ruby 6.0.0.

  • selector: when coalescing connections, pin the current session before merging connections, to prevent it from registering in a selector being used in a different thread, and inadvertedly allowing it to be used across threads.

  • session: fix: always pin connection before early-or-lazy resolution (fixes connection pool accounting under connection coalescing).

Chores

  • logging emits a timestamp as well (to monitor timeouts).

  • :stream_bidi plugin: extends HTTP2 module by using plugin extensions.

  • connection: remove session/selector references when closing a connection (prevents leaking them beyond the usage scope).