Commit Graph

4143 Commits

Author SHA1 Message Date
Stéphane Nicoll
6fc1f72704 Merge branch '6.1.x' 2024-03-12 08:21:08 +01:00
Stéphane Nicoll
88b3844d9b Fix default value in ReactorNettyClientRequestFactory#setExchangeTimeout
Closes gh-32419
2024-03-12 08:13:42 +01:00
Sébastien Deleuze
0435e9c49e Merge branch '6.1.x' 2024-03-11 13:40:23 +01:00
Sébastien Deleuze
80f3be6577 Replace getJvmErasure by getClassifier
Should be slightly faster.

See gh-32334
2024-03-11 13:37:41 +01:00
Sam Brannen
c4e0f96ef7 Polishing 2024-03-11 11:28:59 +01:00
Sébastien Deleuze
5ee11fb1b3 Polish Yaml support
Closes gh-32345
2024-03-11 09:27:25 +01:00
Hyoungjune
6a8f0d6d7d Add web support for Yaml via Jackson
This commit adds support for application/yaml in MediaType and leverages
jackson-dataformat-yaml in order to support Yaml in RestTemplate,
RestClient and Spring MVC.

See gh-32345
2024-03-11 09:22:51 +01:00
Yanming Zhou
246e4977a2 Polishing Optional usage 2024-03-11 09:13:49 +01:00
Sam Brannen
6b64e9992a Merge branch '6.1.x' 2024-03-09 16:31:28 +01:00
Sam Brannen
b4e743614e Restore link to Jakarta Servlet issue tracker 2024-03-09 16:30:14 +01:00
Stéphane Nicoll
e53ed3e3c6 Merge branch '6.1.x' 2024-03-09 16:03:04 +01:00
Stéphane Nicoll
4983a802a7 Polish "Fix Javadoc"
See gh-32403
2024-03-09 16:02:01 +01:00
Maksim Sasnouski
abdccffa39 Fix Javadoc
This commit fixes various Javadoc issues across the code base.

See gh-32403
2024-03-09 16:02:00 +01:00
rstoyanchev
38d5c0fed6 Add RFC-7807 response interception
Closes gh-31822
2024-03-08 16:56:38 +00:00
Sébastien Deleuze
e66d965fed Merge branch '6.1.x' 2024-03-08 09:25:17 +01:00
Yanming Zhou
0e279fe666 Polishing
Closes gh-32397
2024-03-08 09:25:03 +01:00
Sébastien Deleuze
92f4e883b3 Merge branch '6.1.x' 2024-03-07 11:11:46 +01:00
Sébastien Deleuze
c1d4b610ca Refine Kotlin inline class optimizations
Closes gh-32334
2024-03-07 11:11:20 +01:00
rstoyanchev
1a8d64f9d8 Merge branch '6.1.x' 2024-03-06 18:17:40 +00:00
rstoyanchev
5f601ceb45 Mark response errors from @ExceptionHandler as handled
Also fix a couple of related issues:
- add AsyncRequestNotUsableException to the list of exceptions
that imply response issues.
- handle exceptions from @ExceptionHandler regardless of whether
thrown immediately or via Publisher.

Closes gh-32359
2024-03-06 18:17:13 +00:00
rstoyanchev
ddab971fca Merge branch '6.1.x' 2024-03-05 11:42:17 +00:00
rstoyanchev
ef0717935b Test wrapping of response for async request
The following adjustments are also made as a result:
- Use int to check if lock is held and unlock is needed, given that
for non-async requests we don't need to obtain a lock.
- Protect access methods getOutputStream and getWriter with the
same locking and state checks.

Closes gh-32340
2024-03-05 11:42:03 +00:00
Juergen Hoeller
dc6c96de0a Merge branch '6.1.x'
# Conflicts:
#	spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/AbstractFallbackJCacheOperationSource.java
#	spring-context/src/main/java/org/springframework/cache/interceptor/AbstractFallbackCacheOperationSource.java
#	spring-tx/src/main/java/org/springframework/transaction/interceptor/AbstractFallbackTransactionAttributeSource.java
2024-03-04 22:50:22 +01:00
Juergen Hoeller
e9110c0729 Polishing 2024-03-04 22:48:52 +01:00
Sébastien Deleuze
138e7a0e07 Use ServletResponse#getContentType in ServletServerHttpResponse
This commit updates ServletServerHttpResponse.ServletResponseHttpHeaders
in order to use ServletResponse#getContentType instead of
ServletResponse#getHeader.

It allows to have a consistent behavior between Tomcat (which sets only
the former) and Undertow/Jetty (which set both).

Closes gh-32339
2024-03-04 15:32:32 +01:00
Sébastien Deleuze
4ce2559980 Merge branch '6.1.x' 2024-03-04 14:43:18 +01:00
Sébastien Deleuze
7493ce86b6 Fix ServletResponseHttpHeaders#get null handling
ServletResponseHttpHeaders#get should be annotated with `@Nullable` and
return null instead of a singleton list containing null when there is no
content type header.

Closes gh-32362
2024-03-04 14:43:09 +01:00
Sébastien Deleuze
ce9dc19a3c Optimize content type parsing
This commit avoids calling HttpHeaders#getContentType multiple times in
ServletServerHttpResponse#writeHeaders.

Closes gh-32361
2024-03-04 14:43:09 +01:00
rstoyanchev
1c5bb732b9 Merge branch '6.1.x' 2024-03-04 13:36:30 +00:00
rstoyanchev
4b96cd28c0 Add locking in ServletResponse#flushBuffer
In addition to using the ServletOutputStream, it's also possible to call
ServletResponse#flushBuffer, so the ServletOutputStream wrapper logic needs
to apply there as well.

See gh-32340
2024-03-04 13:35:46 +00:00
Sébastien Deleuze
219004ef13 Merge branch '6.1.x' 2024-03-03 22:26:37 +01:00
Sébastien Deleuze
516a203703 Support nullable Kotlin value class arguments
This commit skips the value class parameter instantiation for nullable
types when a null argument is passed.

Closes gh-32353
2024-03-03 22:26:21 +01:00
rstoyanchev
0758c8b14c Merge branch '6.1.x' 2024-03-03 20:53:36 +00:00
rstoyanchev
877e0b1483 Improve concurrent handling of result in WebAsyncManager
1. Use state transitions
2. Increase synchronized scope in setConcurrentResultAndDispatch

See gh-32340
2024-03-03 20:44:52 +00:00
rstoyanchev
379ffac508 Add state and response wrapping to StandardServletAsyncWebRequest
The wrapped response prevents use after AsyncListener onError or completion
to ensure compliance with Servlet Spec 2.3.3.4.

The wrapped response is applied in RequestMappingHandlerAdapter.

The wrapped response raises AsyncRequestNotUsableException that is now
handled in DefaultHandlerExceptionResolver.

See gh-32340
2024-03-03 20:44:36 +00:00
Sébastien Deleuze
bdcd10e228 Merge branch '6.1.x' 2024-03-01 16:53:27 +01:00
Sébastien Deleuze
227e75dae4 Support nullable Kotlin value class arguments
This commit refines WebMVC and WebFlux argument resolution in order to
convert properly Kotlin value class arguments by using the type of the
value instead of the type of the value class.

Closes gh-32353
2024-03-01 16:38:26 +01:00
Sébastien Deleuze
4149d5cb2b Merge branch '6.1.x' 2024-03-01 11:55:08 +01:00
Sébastien Deleuze
85a781d517 Instantiate value class parameters with Kotlin reflection
In order to invoke the init block and to improve the maintainability.

Closes gh-32324
2024-03-01 11:50:19 +01:00
Arjen Poutsma
d81619addd Merge branch '6.1.x' 2024-02-29 15:55:29 +01:00
Patrick Strawderman
beb415dfa3 Optimize HttpHeaders.getAcceptLanguageAsLocales
The HttpHeaders.getAcceptLanguageAsLocales was incurring overhead from
using a Stream, as well as calling the fairly expensive
Locale.getDisplayName method.

Switch to using an ArrayList, and skipping over wildcard ranges to avoid
needing to check the display name.

Closes gh-32318
2024-02-29 15:36:55 +01:00
Juergen Hoeller
4ff0f86ae2 Merge branch '6.1.x' 2024-02-28 21:46:15 +01:00
Juergen Hoeller
154ca54c9f Polishing 2024-02-28 21:40:08 +01:00
Sébastien Deleuze
7c5bcbcba4 Merge branch '6.1.x' 2024-02-28 17:24:08 +01:00
Sébastien Deleuze
45c21042f6 Optimize Kotlin inline class checks
This commit fixes a performance regression caused by gh-31698,
and more specifically by KClass#isValue invocations which are slow since
they load the whole module to find the class to get the descriptor.

After discussing with the Kotlin team, it has been decided that only
checking for the presence of `@JvmInline` annotation is enough for
Spring use case.

As a consequence, this commit introduces a new
KotlinDetector#isInlineClass method that performs such check, and
BeanUtils, CoroutinesUtils and WebMVC/WebFlux InvocableHandlerMethod
have been refined to leverage it.

Closes gh-32334
2024-02-28 17:18:57 +01:00
Sébastien Deleuze
9e7c64270b Merge branch '6.1.x' 2024-02-27 15:52:13 +01:00
Sébastien Deleuze
dc1ef23780 Refine *HttpMessageConverter#getContentLength null safety
Closes gh-32325
2024-02-27 15:51:52 +01:00
Sam Brannen
69dabe9df5 Merge branch '6.1.x' 2024-02-26 18:12:55 +01:00
Sam Brannen
cca440eb8e Do not cache Content-Type in ContentCachingResponseWrapper
Based on feedback from several members of the community, we have
decided to revert the caching of the Content-Type header that was
introduced in ContentCachingResponseWrapper in 375e0e6827.

This commit therefore completely removes Content-Type caching in
ContentCachingResponseWrapper and updates the existing tests
accordingly.

To provide guards against future regressions in this area, this commit
also introduces explicit tests for the 6 ways to set the content length
in ContentCachingResponseWrapper and modifies a test in
ShallowEtagHeaderFilterTests to ensure that a Content-Type header set
directly on ContentCachingResponseWrapper is propagated to the
underlying response even if content caching is disabled for the
ShallowEtagHeaderFilter.

See gh-32039
Closes gh-32317
2024-02-26 17:52:56 +01:00
Sam Brannen
430824038e Merge branch '6.1.x' 2024-02-25 16:28:13 +01:00