# 1.8.2

## Improvements

* `:proxy` plugin: allow setting `:no_proxy` option 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):

```ruby
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 of `http-2`, seamlessly support the new `:closing` state.
* Add missing `response` attribute reader to `HTTPX::RequestTimeoutError`.
* Improve correctness of calling `#dup` on requests and connections.

## Bugfixes

* `:auth` plugin: generate token first, then set the "expires_at" timestamp (bearer tokens, specially if JWT, may carry information about when it expires).
* `:auth` plugin: do not check for token freshness on a retry, instead force token regeneration.
* `:retries` plugin: 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).
* `:retries` plugin: do not retry on any HTTP/2 frame error (only on GOAWAY or PING frame errors).
* `:persistent` plugin: do not decrement request remaining retries on ping or GOAWAY frame errors.
* `:tracing` plugin: set connection initialization time to nil no termination (so that it doesn't get reused on persistent connections after reuse).
* `:follow_redirects` plugin: 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_timeout` helper will make the request raise a `HTTPX::RequestTimeoutError` instead of a plain `TimeoutError` (otherwise, if using persistent sessions, it'd trigger a retry instead and mess with webmock request count bookkeeping).
* native resolver: do not transition to `:open` if 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::ETIMEDOUT` errors 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.