The spring.http.clients.cookie-handling property and
HttpClientSettings.cookieHandling() were honored by every imperative
ClientHttpRequestFactoryBuilder and by the Jetty, JDK and Reactor
ClientHttpConnectorBuilders, but HttpComponentsHttpAsyncClientBuilder
ignored the setting. As a result, a WebClient backed by Apache
HttpComponents kept storing cookies even when cookie handling was
disabled.
Map the setting to the default request config's cookie spec, as
HttpComponentsHttpClientBuilder already does, and document the property
alongside the other global HTTP client settings.
See gh-51724
Signed-off-by: Hyun Lee <dlwhdugs4147@gmail.com>
Three Assert messages named a parameter that does not exist on the
method. In each case the correct name is already used by neighbouring
code in the same class.
Signed-off-by: kdomo <dongho5088@naver.com>
See gh-51568
AbstractClientHttpRequestFactoryBuilder.mergedCustomizers and its
reactive counterpart asserted on the customizers field rather than
the customizer parameter. The field is never null since the
constructor defaults it to an empty list, so the assertion always
passed and a null customizer was not rejected.
See gh-51509
Signed-off-by: kdomo <dongho5088@naver.com>
Update `InetAddressFilter.externalAddresses()` to filter special purpose
IP addresses as defined by RFC 6890. As a byproduct of this commit to
additional factory methods (`specialPurpose()` and `multicast()`) have
also been introduced.
Closes gh-50668
Update default for `ReactorClientHttpRequestFactoryBuilder` and
`ReactorClientHttpConnectorBuilder` to align with Spring Framework.
Also provide method of opting out in case proxyWithSystemProperties is
not wanted.
Closes gh-49950
Add `InetAddressFilter` interface which can be provided by
`HttpSettings` to filter out addresses in order to harden
applications against SSRF attacks.
Closes gh-49687
Remove @ConfigurationPropertiesSource from classes that reside in
the same module as all referencing @ConfigurationProperties classes.
Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
See gh-48934
Update `HttpServiceClientProperties` to use direct binding rather than
using `@ConfigurationProperties`. The prevents metadata and IDE issues
and also allows the class API to be simplified.
Closes gh-48616
Simplify HTTP client configuration properties by sharing common
settings for both blocking and reactive clients.
The `ClientHttpRequestFactorySettings` and `ClientHttpConnectorSettings`
have been merged to a single `HttpClientSettings` class. Properties
to configure common settings are available under:
`spring.http.clients`
Blocking and reactive settings have been moved to
`spring.http.clients.blocking` and `spring.http.clients.reactive`. With
currently only the factory/connector being configurable.
HTTP Service Client properties have also been rationalized under a
`spring.http.serviceclient.<group-name>`. Support for properties that
apply to all service clients and all Rest/Web Clients have been removed.
Support for `ApiVerionInserter` beans has also been removed in favor of
configuring the service group or builders directly.
Closes gh-47398
Update `JettyClientHttpRequestFactoryBuilder` and
`JettyClientHttpConnectorBuilder` with support for create the
`HttpClientTransport` from a factory function.
Closes gh-47251
Add `with` methods to `HttpRequestFactoryBuilder` and
`ClientHttpConnectorBuilder` that operate in a similar way to the
`WebClient.Builder.apply(...)` method.
Closes gh-47205
Refactor `PropertyMapper` so that it no longer calls adapter or
predicate methods by default when the source value is `null`. This
effectively makes all default calls the same as using
`alwaysWhenNotNull` in the previous generation of the code.
For the limited times when you do need to deal with `null` values, the
new `always()` method can be used.
For example,
map.from(source::method).to(destination::method);
Will not call `destination.method(...)` if `source.method()` returns
`null`.
Where as:
map.from(source::method).always().to(destination::method);
Will call `destination.method(null)` if `source.method()` returns
`null`.
This update provides clearer semantics for the API and allows for better
JSpecify nullability annotations. It has also simplified much of our
existing property mapper code.
Closes gh-47024
Co-authored-by: Moritz Halbritter <moritz.halbritter@broadcom.com>
Update JDK HTTP Clients so that the use virtual threads when
`Threading.VIRTUAL` is active.
See gh-46404
Signed-off-by: Sangmin Park <sangmins930@gmail.com>
Update service client configuration so that properties are always
applied when present. Any settings and factory/connector beans that
are present are now only used as fallbacks.
Fixes gh-46915
Refactor `HttpServiceClientAutoConfiguration` and
`ReactiveHttpServiceClientAutoConfiguration` to support scanning for
`@HttpServiceClient` annotated interfaces.
Closes gh-46782