Commit Graph

5152 Commits

Author SHA1 Message Date
Sam Brannen
f6fcf15745 Merge branch '6.1.x' 2024-09-24 12:33:58 +02:00
Sam Brannen
af3a26ab06 Clean up warnings in Gradle build 2024-09-24 12:33:35 +02:00
Sam Brannen
66a518abd5 Merge branch '6.1.x' 2024-09-24 12:23:47 +02:00
Sam Brannen
88905ea20d Upgrade to Apache HttpClient 5.4
This commit also updates the external Javadoc link to avoid the following
warning in the build.

URL https://hc.apache.org/httpcomponents-client-5.2.x/current/httpclient5/apidocs/package-list was redirected to https://hc.apache.org/httpcomponents-client-5.4.x/current/httpclient5/apidocs/package-list

Closes gh-33587
2024-09-24 12:20:44 +02:00
Tran Ngoc Nhan
c85050eb43 Consistently use CharSequence.isEmpty() for emptiness checks
Closes gh-33577
2024-09-23 17:10:21 +02:00
Sam Brannen
8931b75b95 Polishing 2024-09-20 10:58:37 +02:00
Johnny Lim
3ba9d35e22 Polish
Closes gh-33566
2024-09-20 10:58:37 +02:00
rstoyanchev
4706ebc81e Minor refactoring in UrlHandlerFilter
See gh-33565
2024-09-19 11:55:53 +01:00
rstoyanchev
2090ece62a UrlHandlerFilter ignores trailing slash in contextPath
Closes gh-33565
2024-09-19 11:55:25 +01:00
Simon Baslé
c832d5f496 Polishing contribution
Fixes gh-33556
2024-09-18 11:44:29 +02:00
Carl Magnuson
453e7961a8 Add read timeout setter on HttpComponentsClientHttpRequestFactory
This commit adds support for HttpComponentsClientHttpRequestFactory to
set a read timeout, used on the underlying client as a RequestTimeout.

This brings the HttpComponentsClientHttpRequestFactory into alignment
with JDK, Jetty, OkHttp3, Reactor and SimpleClient
ClientHttpRequestFactory implementations.

See gh-33556
2024-09-18 11:44:29 +02:00
Sébastien Deleuze
d3755aba06 Add RestClient.Builder#messageConverters(List)
This commit also introduces the validation of the RestClient
message converters for both variants.

Closes gh-33536
2024-09-13 16:00:38 +02:00
Brian Clozel
0a001482c3 Merge branch '6.1.x' 2024-09-13 15:53:18 +02:00
Brian Clozel
5efb385e64 Read Expires cookie attribute in HttpComponents connector
Prior to this commit, the HttpComponents implementation for the
`WebClient` would only consider the max-age attribute of response
cookies when parsing the response. This is not aligned with other client
implementations that consider the max-age attribute first, and then the
expires if the former was not present. The expires date is then
translated into a max-age duration. This behavior is done naturally by
several implementations.

This commit updates the `HttpComponentsClientHttpResponse` to do the
same.

Fixes gh-33157
2024-09-13 15:49:06 +02:00
Juergen Hoeller
042346aa6a Harmonize Reactor client class names within the http.client package
Closes gh-33382
2024-09-11 16:27:56 +02:00
rstoyanchev
1ff2678147 Add UrlHandlerFilter for WebFlux
Closes gh-32830
2024-09-11 11:51:21 +01:00
rstoyanchev
5671744a94 Refactoring in UrlHandlerFilterTests 2024-09-11 11:51:21 +01:00
rstoyanchev
9d57c0ba89 Add compare method to ETag
Closes gh-33385
2024-09-10 12:29:33 +01:00
rstoyanchev
19700d07b1 Quote ETag if not quoted in HttpHeaders#setETag
This aligns HttpHeaders with other places like ServletWebRequest and
DefaultWebExchange where an ETag is accepted as input.

It also allows us to remove quoting from places that delegate to
HttpHeaders#setETag since it now does that internally.

Closes gh-33412
2024-09-10 09:17:56 +01:00
rstoyanchev
3dd4a8350a Update more places to use quoteETagIfNecessary
Closes gh-33412
2024-09-10 08:56:03 +01:00
rstoyanchev
1b26122e64 Polishing and minor refactoring
Update checks whether quoting is needed to be more complete
than what we've used so far, making sure the there is both
opening and closing quotes independent of each other.

See gh-33412
2024-09-10 08:56:01 +01:00
hyunmin0317
80b264ba82 Refactor eTag formatting into utility method
See gh-33412
2024-09-10 08:55:39 +01:00
Sébastien Deleuze
cc3f4b87ff Update mime.types
This commit updates mime.types based on revision 1918129 of
https://svn.apache.org/viewvc/httpd/httpd/trunk/docs/conf/mime.types.

Closes gh-33512
2024-09-09 19:23:57 +02:00
Sébastien Deleuze
413cbca2c0 Remove commented entries from mime.types
See gh-33512
2024-09-09 18:59:29 +02:00
Sam Brannen
eff19ec972 Sync MockHttpServletRequest implementations 2024-09-09 15:42:21 +02:00
rstoyanchev
d2b25c0378 Merge branch '6.1.x' 2024-09-09 11:56:21 +01:00
rstoyanchev
3d1bf28445 Refine how async request state lock is obtained
Rather than waiting indefinitely, keep checking if the state
changed from ASYNC (e.g. to ERROR).

Closes gh-33421
2024-09-09 11:54:38 +01:00
Sébastien Deleuze
5e3c5d466f Avoid collecting Flux elements in KotlinSerializationJsonEncoder
Closes gh-33428
2024-09-05 14:47:49 +02:00
Sébastien Deleuze
2f56a59ba0 Merge branch '6.1.x' 2024-09-04 16:13:04 +02:00
Sébastien Deleuze
4b7292f431 Fix an off-by-one bug in ForwardedHeaderTransformer
Consistently with what is done in ForwardedHeaderFilter.

Closes gh-33465
2024-09-04 16:12:44 +02:00
zhoukq
aca264942d Update Content-Length if body changed by client interceptor
Prior to this commit, the HTTP interceptor model used for `RestTemplate`
and `RestClient` would not update the "Content-Length" request header,
even when the request body had been updated by a
`ClientHttpRequestInterceptor`.

Even though this is the `ClientHttpRequestInterceptor`'s responsibility
(along with the content type and encoding changes if needed), this
would result in invalid requests. This invalid situation can be detected
by `InterceptingClientHttpRequest`.

This commit ensures that such situations are detected and fixed
automatically by setting the Content-Length header to the actual body
size, right before executing the actual request, after all interceptors
are done.

Closes gh-33459
2024-09-02 16:19:26 +02:00
Brian Clozel
be5d5fa52d UrlHandlerFilter should not strip slash for "/" request paths
This commit ensures that the `UrlHandlerFilter` does not handle "/"
paths in general, as they should not be altered and are meaningful for
web applications.

Closes gh-33444
2024-09-02 15:29:42 +02:00
Brian Clozel
52c4ffa4d2 Merge branch '6.1.x' 2024-08-30 21:23:29 +02:00
Brian Clozel
debba6545b Listen to multiple async operations in ServerHttpObservationFilter
Prior to this commit, the `ServerHttpObservationFilter` was fixed to
re-enable instrumentation for async dispatches. This fix involves using
an AsyncListener to be notified of exchange completion.

This change was incomplete, as this would not work in some cases.
If another filter starts the async mode and initiates an ASYNC dispatch,
before async handling at the controller level, the async listener is not
registered against subsequent async starts.

This commit not only ensures that the async listener registers
against new async starts, but also ensure that the initial creation and
registration only happens during the initial REQUEST dispatch.

Fixes gh-33451
2024-08-30 20:09:21 +02:00
Brian Clozel
fab889009a Support multiple async starts in MockHttpServletRequest
Closes gh-33457
2024-08-30 20:08:36 +02:00
Sam Brannen
167cb5d494 Polishing 2024-08-29 17:02:08 +02:00
Sam Brannen
2ddf495802 Delete unused method and polish formatting 2024-08-29 16:53:49 +02:00
rstoyanchev
7aa25e083a Merge branch '6.1.x' 2024-08-28 18:59:47 +03:00
rstoyanchev
186deb777f Update deprecation notices on rawStatusCode
Mark for removal where not marked, and set to 7.0
consistently as the target for removal.

See gh-33440
2024-08-28 18:49:49 +03:00
rstoyanchev
57cb8c7abf Restore rawStatusCode methods
Revert methods removed in 7df2e2a8d2.

See gh-33440
2024-08-28 18:12:26 +03:00
Sam Brannen
9f0417fb33 Merge branch '6.1.x' 2024-08-19 13:58:31 +02:00
Sam Brannen
b2c1f978a4 Stop logging result in WebAsyncManager
Closes gh-33406
2024-08-19 13:53:06 +02:00
Brian Clozel
96573ee5e1 Merge branch '6.1.x' 2024-08-19 11:48:36 +02:00
Brian Clozel
50be08480d Open observation scope in RestClient
Prior to this commit, the `RestClient` instrumentation would create and
close observations for HTTP requests, but would not open an observation
scope for the lifetime of the exchange.
This means that custom `ClientHttpRequestInterceptor` and
`ResponseErrorHandler` would not get access to the current observation
scope in case of tracing, possibly leading to missing trace ids in logs.

This commit ensures that an observation scope is managed for the
lifetime of the HTTP exchange.

Fixes gh-33397
2024-08-19 11:48:26 +02:00
Sébastien Deleuze
eb7a95cfdb Merge branch '6.1.x' 2024-08-19 09:47:08 +02:00
Sébastien Deleuze
d41ca095ab Add native support for Kotlin default values in controllers
Closes gh-33384
2024-08-19 09:46:53 +02:00
Sam Brannen
346b6f740a Polish contribution
See gh-33401
2024-08-18 14:58:05 +02:00
tafjwr
4ffeddb099 Add tests for ControllerAdviceBean#resolveBean() and revise existing tests
Closes gh-33401
2024-08-18 14:52:05 +02:00
Sam Brannen
04271c3ead Merge branch '6.1.x' 2024-08-18 13:04:21 +02:00
Sam Brannen
143736e59b Enforce order of Javadoc tags for records
Closes gh-33403
2024-08-18 13:01:43 +02:00