Skip to content

Release 3.2.0 - #20

Merged
kampute merged 1 commit into
masterfrom
v3.2.0
Oct 8, 2026
Merged

kampute merged 1 commit into
masterfrom
v3.2.0

Conversation

@kampute

@kampute kampute commented Oct 8, 2026

Copy link
Copy Markdown
Owner
  • Stop advertising problem details media types
    The JSON and XML formatters no longer list application/problem+json and application/problem+xml among their readable media types, so the Accept header that the client builds no longer includes them. The formatters still read them through the +json and +xml suffix rules. The documentation no longer describes problem details, because the library has no specific support for them.

  • Decode XML responses as RFC 7303 specifies
    Without a charset parameter, XmlFormatter decoded the content as UTF-8 through a text reader, so the XML encoding declaration was ignored. A byte order mark now decides the encoding, then the charset parameter, then the encoding declaration, with UTF-8 as the default.

  • Keep the path of a base address without a trailing slash
    BaseAddress appended the slash by resolving "/" against the address, which replaces its path, so http://example.com/api became http://example.com/ instead of http://example.com/api/.

  • Recognize more transient network errors
    IsTransientNetworkError now also treats as transient:

    • An IOException, including HttpIOException, which reports a connection closed before the response was complete, unless it is an HTTP/2 or HTTP/3 protocol error.
    • A WebException of .NET Framework for a failed connection, send, or receive, a connection closed early, a failed host name resolution, or a timeout.
    • SocketError.Shutdown, which .NET on Unix reports for a write to a connection the peer closed, and AddressNotAvailable, NoBufferSpaceAvailable, and TooManyOpenSockets, which report exhausted local ports, buffers, or sockets.
  • Correct documentation

    • CompressedContent is sent with chunked transfer encoding only over HTTP/1.1.
    • The shared HttpClient is disposed with its last client, so clients share a connection pool only while they exist at the same time.
    • The user guide and SharedHttpClient.Factory explain how to make the shared HttpClient follow DNS changes with PooledConnectionLifetime.
  • Add tests for untested behavior
    Tests cover body parsing failures, cancellation while reading a body, unreadable error bodies, connection failures that are not retried, SharedHttpClient.Factory, a 401 handler that gets no new authorization, PerformAsync, and the ToString of HttpResponseException and HttpContentException.

  • Add the .NET Framework test project to the solution, and use collection expressions in test assertions

@kampute kampute changed the title Fix XML decoding, base address paths, and transient error detection Release 3.2.0 Oct 8, 2026
* Stop advertising problem details media types

The JSON and XML formatters no longer list application/problem+json and application/problem+xml among their readable media types, so the Accept header that the client builds no longer includes them. The formatters still read them through the +json and +xml suffix rules. The documentation no longer describes problem details, because the library has no specific support for them.

* Decode XML responses as RFC 7303 specifies

Without a charset parameter, XmlFormatter decoded the content as UTF-8 through a text reader, so the XML encoding declaration was ignored. A byte order mark now decides the encoding, then the charset parameter, then the encoding declaration, with UTF-8 as the default.

* Keep the path of a base address without a trailing slash

BaseAddress appended the slash by resolving "/" against the address, which replaces its path, so http://example.com/api became http://example.com/ instead of http://example.com/api/.

* Recognize more transient network errors

IsTransientNetworkError now also treats as transient:
- An IOException, including HttpIOException, which reports a connection closed before the response was complete, unless it is an HTTP/2 or HTTP/3 protocol error.
- A WebException of .NET Framework for a failed connection, send, or receive, a connection closed early, a failed host name resolution, or a timeout.
- SocketError.Shutdown, which .NET on Unix reports for a write to a connection the peer closed, and AddressNotAvailable, NoBufferSpaceAvailable, and TooManyOpenSockets, which report exhausted local ports, buffers, or sockets.

Every SocketError and WebExceptionStatus value is listed explicitly. Retries still do not depend on the request method.

* Correct documentation

- CompressedContent is sent with chunked transfer encoding only over HTTP/1.1.
- The shared HttpClient is disposed with its last client, so clients share a connection pool only while they exist at the same time.
- The user guide and SharedHttpClient.Factory explain how to make the shared HttpClient follow DNS changes with PooledConnectionLifetime.

* Add tests for untested behavior

Tests cover body parsing failures, cancellation while reading a body, unreadable error bodies, connection failures that are not retried, SharedHttpClient.Factory, a 401 handler that gets no new authorization, PerformAsync<T>, and the ToString of HttpResponseException and HttpContentException.

* Add the .NET Framework test project to the solution, and use collection expressions in test assertions
@kampute
kampute merged commit 7528f9a into master Oct 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants