From 36017d7bf6a988a9da0d3840a633a5a45e87325b Mon Sep 17 00:00:00 2001 From: HoneyryderChuck Date: Wed, 25 Jan 2023 12:23:56 +0000 Subject: [PATCH] bump version to 0.22.3 --- doc/release_notes/0_22_2.md | 2 +- doc/release_notes/0_22_3.md | 55 +++++++++++++++++++++++++++++++++++++ lib/httpx/version.rb | 2 +- 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 doc/release_notes/0_22_3.md diff --git a/doc/release_notes/0_22_2.md b/doc/release_notes/0_22_2.md index e8a23fb8..3b7d1734 100644 --- a/doc/release_notes/0_22_2.md +++ b/doc/release_notes/0_22_2.md @@ -1,4 +1,4 @@ -# 0.22.1 +# 0.22.2 ## Chore diff --git a/doc/release_notes/0_22_3.md b/doc/release_notes/0_22_3.md new file mode 100644 index 00000000..ba0f3864 --- /dev/null +++ b/doc/release_notes/0_22_3.md @@ -0,0 +1,55 @@ +# 0.22.3 + +## Features + +### HTTPX::Response::Body#filename + +A new method, `.filename` can be called on response bodies, to get the filename referenced by the server for the received payload (usually in the "Content-Disposition" header). + +```ruby +response = HTTPX.get(url) +response.raise_for_status +filename = response.body.filename +# you can do, for example: +response.body.copy_to("/home/files/#{filename}") +``` + +## Improvements + +### Loading integrations by default + +Integrations will be loaded by default, as long as the dependency being integrated is already available: + +```ruby +require "ddtrace" +require "httpx" + +HTTPX.get(... # request will be traced via the datadog integration +``` + +### Faraday: better error handling + +The `faraday` adapter will not raise errors anymore, when used in parallel mode. This fixes the difference in behaviour with the equivalent `typhoeus` parallel adapter, which does not raise errors in such cases as well. This behaviour will exclude 4xx and 5xx HTTP responses, which will not be considered errors in the `faraday` adapter. + +If errors occur in parallel mode, these'll be available in `env[:error]`. Users can check it in two ways: + +```ruby +response.status == 0 +# or +!response.env[:error].nil? +``` + +## Bugfixes + +* unix socket: handle the error when the path for the unix sock is invalid, which was causing an endless loop. + +### IPv6 / Happy eyeballs v2 + +* the `native` resolver will now use IPv6 nameservers with zone identifier to perform DNS queries. This bug was being ignored prior to ruby 3.1 due to some pre-filtering on the nameservere which were covering misuse of the `uri` dependency for this use case. +* Happy Eyeballs v2 handshake error on connection establishment for the first IP will now ignore it, in case an ongoing connecting for the second IP is happening. This fixes a case where both IPv4 and IPv6 addresses are served for a given domain, but only one of them can be connected to (i.e. if connection via IPv6 fails, the IPv4 one should still proceed to completion). +* the `native` resolver won't try querying DNS name candidates, if the resolver sends an empty answer with an error code different from "domain not found". +* fix error of Happy Eyeballs v2 handshake, where the resulting connection would coalesce with an already open one for the same IP **before** requests were merged to the coalesced connection, resulting in no requests being sent and the client hanging. + +## Chore + +* fixed error message on wrong type of parameter for the `compression_threshold_size` option from the `:compression` plugin. \ No newline at end of file diff --git a/lib/httpx/version.rb b/lib/httpx/version.rb index e371719c..91e5f494 100644 --- a/lib/httpx/version.rb +++ b/lib/httpx/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module HTTPX - VERSION = "0.22.2" + VERSION = "0.22.3" end