Commit Graph

4253 Commits

Author SHA1 Message Date
rstoyanchev
da3b59e7a9 Merge branch '6.1.x' 2024-05-15 20:07:13 +01:00
rstoyanchev
010e8a303b Polishing contribution
Closes gh-32799
2024-05-15 20:06:48 +01:00
Matteo Cristoforo
78549d4963 Fix cookie management in reactive JdkClientHttpRequest
Prevent cookies to be set to empty in the HTTP request if no cookie
is present

See gh-32799
2024-05-15 20:02:04 +01:00
rstoyanchev
edb6bb717d Add UrlHandlerFilter
Closes gh-31366
2024-05-15 18:45:07 +01:00
rstoyanchev
48ad7b1bcd Remove unused code in WebHttpHandlerBuilder
The code was necessary while ForwardedHeaderFilter was deprecated
but still possible to use. When the filter was removed, this code
could have been removed as well.
2024-05-15 18:45:07 +01:00
mysend12
3547491590 Handle DataBufferLimitException as HTTP 413 responses
Prior to this commit, `DataBufferLimitException` would be thrown by
codecs when the request body was too large for the configured buffer
limit. This exception would not be handled by the web infrastructure and
would result in an HTTP 500 server error.

This commit introduces a new `PayloadTooLargeException` type that will
result in an HTTP 413 "Payload too large" response status.

Closes gh-32558
2024-05-13 14:07:21 +02:00
rstoyanchev
10e3d3b434 Merge branch '6.1.x' 2024-05-13 11:41:22 +01:00
rstoyanchev
2c9ed4608f Improve RequestAttributesThreadLocalAccessor
Ensure access to request attributes after initial REQUEST dispatch
is done, and the RequestAttributes markedCompleted.

Closes gh-32296
2024-05-13 11:41:07 +01:00
rstoyanchev
a5a1ef6b30 Use instance field for ProblemDetail in ErrorResponse's
Closes gh-32644
2024-05-13 11:40:32 +01:00
Brian Clozel
5cb4985234 Merge branch '6.1.x' 2024-05-13 10:44:09 +02:00
Brian Clozel
89ce63f1f3 Replace RFC7807 by RFC9457 in documentation
This commit updates all references to RFC7807 by RFC9457 since the
former is now obsolete.

Closes gh-32806
2024-05-13 10:42:35 +02:00
Juergen Hoeller
645556a28c Merge branch '6.1.x' 2024-05-07 15:53:00 +02:00
Juergen Hoeller
4f02be263f Polishing 2024-05-07 15:52:13 +02:00
Juergen Hoeller
3048cfe9d9 Polishing 2024-05-06 20:16:07 +02:00
Juergen Hoeller
d9ca263065 Merge branch '6.1.x' 2024-05-06 20:11:56 +02:00
Juergen Hoeller
05d9b52b19 Polishing 2024-05-06 20:10:40 +02:00
Sébastien Deleuze
12272d6e41 Remove unneeded @SuppressWarnings("NullAway")
Closes gh-32542
2024-05-06 18:28:54 +02:00
Arjen Poutsma
8bca7cd8e7 Various UrlParser improvements
- Consistent use of codePointAt instead of charAt.
- Fix bug in domainToAscii

See gh-32513
2024-05-03 13:41:56 +02:00
Arjen Poutsma
4df80a8d09 Various CPU and memory improvements in UrlParser
Improvements include:
- Replace throwing exceptions with failure results in hot areas,
- Verify digits of a string before passing it to Integer::parseInt
- Lazily initialization of fields
- Using LinkedList instead of ArrayList where size is not known
  beforehand

See gh-32513
2024-05-03 13:41:55 +02:00
Stéphane Nicoll
305ebca56d Merge branch '6.1.x' 2024-05-02 17:02:08 +02:00
Stéphane Nicoll
abcc1dfc6c Review usage of BindingReflectionHintsRegistrar#registerReflectionHints
Closes gh-32753
2024-05-02 16:53:59 +02:00
Brian Clozel
09ca4cdc70 Merge branch '6.1.x' 2024-05-02 16:01:56 +02:00
Brian Clozel
47c5cd208c Add missing "Content-Length: 0" header with HttpComponents
Prior to this commit, HTTP requests sent with the
`HttpComponentsClientHttpRequestFactory` would not set a
"Content-Length" header for empty request bodies. Setting a request
entity is the expected behavior for unsafe HTTP methods, and this would
align the behavior with other HTTP clients.
Developers would often rely on `BufferingClientHttpRequestFactory` to
set this information on the request.

This commit ensures that a `NullEntity` is used for unsafe HTTP methods,
when no body has been set for the request. This result in a
"Content-Length:0" request header.

Fixes gh-32678
2024-05-02 15:42:35 +02:00
Arjen Poutsma
7ccd4ce886 Reduce logging level in UrlParser
See gh-32513
2024-05-02 15:33:06 +02:00
Stéphane Nicoll
759ec52fd2 Merge branch '6.1.x' 2024-05-02 11:49:24 +02:00
Stéphane Nicoll
f90bdbef42 Add noop implementation for ResponseErrorHandler
Closes gh-32750
2024-05-02 11:44:42 +02:00
Brian Clozel
02b3801f1a Merge branch '6.1.x' 2024-05-02 09:17:01 +02:00
Brian Clozel
64b0283042 Revert "Do not set 0 Content-Length header in BufferingClientHttpRequestFactory"
This reverts commit b3a45670f9.

See gh-32650
2024-05-02 09:11:54 +02:00
Arjen Poutsma
37dd47c6fc Set request timeout in JettyClientHttpRequestFactory
Closes gh-32330
2024-05-01 09:58:35 +02:00
Arjen Poutsma
0241a02e66 Fix guard against multiple subscriptions
This commit changes the guard against multiple subscriptions, as the
previously used doOnSubscribe hook could not function as guard in
certain scenarios.

Closes gh-32727
2024-04-30 16:07:03 +02:00
Arjen Poutsma
a3afe51c9f Fix guard against multiple subscriptions
This commit changes the guard against multiple subscriptions, as the
previously used doOnSubscribe hook could not function as guard in
certain scenarios.

Closes gh-32727
2024-04-30 16:06:53 +02:00
Stéphane Nicoll
f85c4e1ea7 Polish "Include URL and HTTP method in DefaultResponseErrorHandler"
See gh-28958
2024-04-30 11:34:17 +02:00
jerzykrlk
4972d18dd6 Include URL and HTTP method in DefaultResponseErrorHandler
See gh-28958
2024-04-30 11:34:17 +02:00
Arjen Poutsma
3cfa4ed4f7 Various UrlParser improvements
See gh-32513
2024-04-26 11:44:32 +02:00
Juergen Hoeller
0402ea13c0 Merge branch '6.1.x' 2024-04-24 13:42:43 +02:00
Juergen Hoeller
09b476ac18 Polishing 2024-04-24 13:42:02 +02:00
rstoyanchev
75a5409c97 Add PreFlightRequestHandler for Spring MVC
This is equivalent of the same contract for WebFlux. It is implemented
by HandlerMappingIntrospector, and may be called directly by Spring
Security to handle a pre-flight request without delegate to the rest
of the filter chain.

HandlerMappingIntrospector also has the boolean method
allHandlerMappingsUsePathPatternParser that checks whether all handler
mappings are configured to use parsed PathPattern's.

See gh-31823
2024-04-23 19:00:10 +01:00
Juergen Hoeller
3991cae875 Merge branch '6.1.x' 2024-04-23 16:07:46 +02:00
Juergen Hoeller
580adfcbed Polishing 2024-04-23 16:07:09 +02:00
Stéphane Nicoll
a77895bd90 Merge branch '6.1.x' 2024-04-23 15:34:49 +02:00
Stéphane Nicoll
95ac0eae4a Update copyright year of changed files
See gh-32696
2024-04-23 15:32:59 +02:00
Johnny Lim
cc73ccefef Polish
See gh-32696
2024-04-23 15:31:48 +02:00
Arjen Poutsma
6c5ef9715b Polishing external contribution
See gh-32622
2024-04-23 14:59:28 +02:00
Sergey Zolotaryov
3f8a10c19f Remove Content-Type when body is empty
Closes gh-32622
See gh-32620
2024-04-23 14:58:20 +02:00
Juergen Hoeller
adc7f73170 Merge branch '6.1.x' 2024-04-23 13:17:08 +02:00
Juergen Hoeller
d4ddbd537b Polishing 2024-04-23 13:16:33 +02:00
Brian Clozel
c80bf57834 Merge branch '6.1.x' 2024-04-20 19:46:23 +02:00
Brian Clozel
5aa576f5c6 Register status handler exceptions in observations
Prior to this commit, `RestClientException` thrown by status handlers
would not be registered as observation errors. This commit ensures that
such exceptions are first caught, registered in the observation and
rethrown as expected.

Closes gh-32575
2024-04-20 19:44:11 +02:00
Brian Clozel
0893cf948d Merge branch '6.1.x' 2024-04-18 21:27:50 +02:00
Brian Clozel
da4547a27e Extend observations to RestClient ResponseSpec
Prior to this commit, the `RestClient` observations would be stopped as
soon as the exchange function was called. This means that all errors
related to response decoding or mapping would not be recorded by the
obsevations.

This commit extends the observation recording to the `ResponseSpec` DSL
calls as well as custom exchange functions.

Fixes gh-32575
2024-04-18 21:26:18 +02:00