-
Change request.headers and response.headers to be maps.
-
Ensure request.headers and response.headers are downcased.
Per RFC 9110: HTTP Semantics, HTTP headers should be case-insensitive. However, per RFC 9113: HTTP/2 headers must be sent downcased.
Req headers are now stored internally downcased and all accessor functions like Req.Response.get_header/2 are downcasing the given header name.
-
Add trailers field to Req.Response struct. Trailer field is only filled in on Finch 0.17+.
-
Make request.registered_options internal representation private.
-
Make request.options internal representation private.
Currently request.options field is a map but it may change in the future. One possible future change is using keywords lists internally which would allow, for example, Req.new(params: [a: 1]) |> Req.update(params: [b: 2]) to keep duplicate :params in request.options which would then allow to decide the duplicate key semantics on a per-step basis. And so, for example, put_params would merge params but most steps would simply use the first value.
To have some room for manoeuvre in the future we should stop pattern matching on request.options. Calling request.options[key], put_in(request.options[key], value), and update_in(request.options[key], fun) is allowed.
-
Fix typespecs for some functions
-
Deprecate output step in favour of into: File.stream!(path).
-
Rename follow_redirects step to redirect
-
redirect: Rename :follow_redirects option to :redirect.
-
redirect: Rename :location_trusted option to :redirect_trusted.
-
redirect: Change HTTP request method to GET only on POST requests that result in 301..303.
Previously we were changing the method to GET for all 3xx except 307 and 308.
-
decompress_body: Remove support for deflate compression (which was broken)
-
decompress_body: Don't crash on unknown codec
-
decompress_body: Fix handling HEAD requests
-
decompress_body: Re-calculate content-length header after decompresion
-
decompress_body: Remove content-encoding header after decompression
-
decode_body: Do not decode response with content-encoding header
-
run_finch: Add :inet6 option
-
retry: Support retry: :safe_transient which retries HTTP 408/429/500/502/503/504 or exceptions with reason field set to :timeout/:econnrefused.
:safe_transient is the new default retry mode. (Previously we retried on 408/429/5xx and any exception.)
-
retry: Support retry: :transient which is the same as :safe_transient except it retries on all HTTP methods
-
retry: Use retry-after header value on HTTP 503 Service Unavailable. Previously only HTTP 429 Too Many Requests was using this header value.
-
retry: Support retry: &fun/2. The function receives request, response_or_exception and returns either:
-
retry: Deprecate retry: :safe in favour of retry: :safe_transient
-
retry: Deprecate retry: :never in favour of retry: false
-
Req.request/2: Improve error message on invalid arguments
-
Req.update/2: Do not duplicate headers
-
Req.update/2: Merge :params
-
Req.Request: Fix displaying redacted basic authentication
-
Req.Request: Add Req.Request.get_option/3
-
Req.Request: Add Req.Request.fetch_option/2
-
Req.Request: Add Req.Request.fetch_option!/2
-
Req.Request: Add Req.Request.delete_option/2
-
Req.Response: Add Req.Response.delete_header/2
-
Req.Response: Add Req.Response.update_private/4