Commit Graph

24054 Commits

Author SHA1 Message Date
Kasper Bisgaard
5dfec09edd Allow UriTemplate to be built with an empty template
Closes gh-32438
2024-03-13 17:38:27 +01:00
Juergen Hoeller
5056e8cbfb Upgrade to Reactor 2020.0.42
Closes gh-32422
2024-03-12 20:35:39 +01:00
Juergen Hoeller
4566e8685d Polishing
(cherry picked from commit 723c94e5ac)
2024-03-12 20:35:30 +01:00
Sam Brannen
1b84f970de Disable external Javadoc URLs not supported on JDK 8
This commit comments out (disables) 3 external Javadoc URLs, since the
javadoc tool on JDK 8 cannot access them.
2024-03-11 13:03:36 +01:00
Sébastien Deleuze
41bc43b033 Build KDoc against 5.3.x Spring Framework Javadoc
Closes gh-32414
2024-03-11 10:19:49 +01:00
Juergen Hoeller
915d5bddea Polishing 2024-03-08 19:49:28 +01:00
rstoyanchev
dc86feaeb6 Remove IOException that's not thrown from Javadoc 2024-03-07 16:16:30 +00:00
rstoyanchev
ff412de247 Use wrapped response in HandlerFunctionAdapter
webmvc.fn now also uses the StandardServletAsyncWebRequest wrapped response
to enforce lifecycle rules from Servlet spec (section 2.3.3.4).

See gh-32342
2024-03-07 15:00:08 +00:00
rstoyanchev
5d572f6490 Fix checkstyle violation 2024-03-05 12:39:48 +00:00
rstoyanchev
b8b1f5b6be Add missed merge changes from last commit
See gh-32342
2024-03-05 12:28:54 +00:00
rstoyanchev
99e38ecf41 Backport tests for wrapping of response for async requests
This is a backport of commits 4b96cd and ef0717.

Closes gh-32342
2024-03-05 12:11:55 +00:00
Juergen Hoeller
ed0c2ff37f Restore ability to return original method for proxy-derived method
Closes gh-32365
2024-03-04 23:42:04 +01:00
rstoyanchev
e668e7767c Wrap PrintWriter in StandardServletAsyncWebRequest
Closes gh-32342
2024-03-03 18:38:40 +00:00
rstoyanchev
30c75ffe8e Avoid locking if not handling asynchronously
Avoid the overhead of locking in the ServletOutputStream wrapper
if it is not an asynchronous request.

See gh-32342
2024-03-03 18:38:05 +00:00
rstoyanchev
dd5fe68522 Dispatch again after disconnected client error
Dispatching was prevented for disconnected client errors after
recent reports like #32042 when running on Tomcat, and the
async request was completed from the onError notification.
This has the side effect of not allowing exception resolvers
to take final action even if the response is not writeable.

After all updates for this issue, it appears the dispatch no
longer causes issues. Tomcat actually does not do the dispatch,
but it doesn't seem to cause any issues, and on other servers
like Jetty where the dispatch works, applications can have a
chance to handle the exception.

This change removes the disconnected client checks and allows
dispatching again. After the change DisconnectedClientHelper
is no longer needed in the 5.3.x branch.

See gh-32342
2024-03-03 18:37:21 +00:00
rstoyanchev
2aca714010 Add locking in StandardServletAsyncWebRequest
The lock protects against race between onError/onComplete notifications
and operations on the ServletOutputStream.

See gh-32342
2024-03-01 18:21:59 +00:00
rstoyanchev
3b7c435134 Polishing
See gh-32342
2024-03-01 15:57:16 +00:00
rstoyanchev
6432b13a4c 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.

See gh-32342
2024-03-01 14:31:41 +00:00
rstoyanchev
3478a702e5 Improve concurrent handling of result in WebAsyncManager
1. Use state transitions
2. Increase synchronized scope in setConcurrentResultAndDispatch

See gh-32342
2024-02-29 20:43:31 +00:00
rstoyanchev
b31550fd85 Align 5.3.x with 6.1.x
In preparation for a larger update, start by aligning with
6.1.x, which includes changes for gh-32042 and gh-30232.

See gh-32342
2024-02-29 17:48:09 +00:00
Juergen Hoeller
701e9e410f Polishing 2024-02-28 21:13:10 +01:00
Juergen Hoeller
ce385d136d Consistent nullability for internal field access 2024-02-28 21:12:57 +01:00
Arjen Poutsma
e44f84e8ee Restore Jetty 10 compatibility in JettyClientHttpResponse
Closes gh-32337
2024-02-28 13:33:18 +01:00
Sam Brannen
464fa7ea0e 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
See gh-32317
Closes gh-32322
2024-02-28 11:13:59 +01:00
Sam Brannen
6e1f583c06 Polish ShallowEtagHeaderFilterTests 2024-02-28 11:06:55 +01:00
Sébastien Deleuze
57646a092e Refine *HttpMessageConverter#getContentLength null safety
Closes gh-32332
2024-02-27 15:50:06 +01:00
Sam Brannen
380f5d5ea4 Honor Content-[Type|Length] headers from wrapped response again
Commit 375e0e6827 introduced a regression in
ContentCachingResponseWrapper (CCRW). Specifically, CCRW no longer
honors Content-Type and Content-Length headers that have been set in
the wrapped response and now incorrectly returns null for those header
values if they have not been set directly in the CCRW.

This commit fixes this regression as follows.

- The Content-Type and Content-Length headers set in the wrapped
  response are honored in getContentType(), containsHeader(),
  getHeader(), and getHeaders() unless those headers have been set
  directly in the CCRW.

- In copyBodyToResponse(), the Content-Type in the wrapped response is
  only overridden if the Content-Type has been set directly in the CCRW.

Furthermore, prior to this commit, getHeaderNames() returned duplicates
for the Content-Type and Content-Length headers if they were set in the
wrapped response as well as in CCRW.

This commit fixes that by returning a unique set from getHeaderNames().

This commit also updates ContentCachingResponseWrapperTests to verify
the expected behavior for Content-Type and Content-Length headers that
are set in the wrapped response as well as in CCRW.

See gh-32039
See gh-32317
Closes gh-32322
2024-02-25 18:08:12 +01:00
Sam Brannen
1acc1c3a27 Polish ContentCachingResponseWrapper[Tests] 2024-02-25 18:02:59 +01:00
Spring Builds
6ad75bdb4a Next development version (v5.3.33-SNAPSHOT) 2024-02-15 13:40:21 +00:00
Juergen Hoeller
8e3ad4a488 Upgrade to Reactor 2020.0.41
Includes Jetty 9.4.54, Netty 4.1.107, Undertow 2.2.29
2024-02-15 10:40:25 +01:00
Juergen Hoeller
6f4cc40a52 Document ResourcePropertiesPersister as only intended for internal use 2024-02-13 11:32:18 +01:00
Juergen Hoeller
452973fbbd Consistent Lock field declaration (instead of ReentrantLock field type)
(cherry picked from commit b4153618a4)
2024-02-13 11:31:55 +01:00
rstoyanchev
7ec5c994c1 Update user info pattern
Closes gh-32211
2024-02-13 07:18:50 +00:00
Juergen Hoeller
60035b5e39 Polishing 2024-02-01 17:41:50 +01:00
Juergen Hoeller
43ecb0b94a Eagerly initialize ZERO_NANOS constant 2024-01-29 16:27:18 +01:00
Juergen Hoeller
0e5edc4474 Upgrade to Checkstyle 10.12.7 and spring-javaformat-checkstyle 0.0.41 2024-01-29 16:02:27 +01:00
Juergen Hoeller
70e2e89602 Explicit documentation note on cron-vs-quartz parsing convention
Closes gh-32128
2024-01-29 16:02:19 +01:00
Juergen Hoeller
a2af34f9b6 Polishing 2024-01-24 22:48:27 +01:00
Juergen Hoeller
c35e90c171 Compare qualifier value arrays with equality semantics
Closes gh-32106

(cherry picked from commit c5a75219ce)
2024-01-24 22:48:12 +01:00
Arjen Poutsma
186d6e370d Guard against multiple body subscriptions
Before this commit, the Jetty connector did not have any
safeguard against multiple body subscriptions. Such as check has now
been added.

See gh-32100
Closes gh-32101
2024-01-24 14:05:06 +01:00
Juergen Hoeller
732642d8ad Declare allowPrivateNetwork as available since 5.3.32
See gh-28546
See gh-31974
2024-01-24 12:22:51 +01:00
Juergen Hoeller
d7649d088d Polishing 2024-01-24 12:20:35 +01:00
Juergen Hoeller
7ac66eff4d Consistent nullability for concurrent result
(cherry picked from commit b92877990d)
2024-01-24 12:05:33 +01:00
Juergen Hoeller
f22bdf4734 Polishing 2024-01-19 17:29:16 +01:00
Arjen Poutsma
a0f24cf485 Handle Content-Length in ShallowEtagHeaderFilter more robustly
This commit ensures that setting the Content-Length through
setHeader("Content-Length", x") has the same effect as calling
setContentLength in the ShallowEtagHeaderFilter. It also filters out
Content-Type headers similarly to Content-Length.

See gh-32039
Closes gh-32051
2024-01-18 16:07:02 +01:00
Brian Clozel
562fa4e1ad Upgrade CI image to JDK 8u402+7 and 17.0.10+13 2024-01-17 21:17:46 +01:00
Brian Clozel
9d10807f8b Upgrade CI image to Ubuntu Jammy 20240111 2024-01-17 21:17:05 +01:00
rstoyanchev
fd240b3b86 Double-checked lock in ChannelSendOperator#request
Closes gh-31865
2024-01-12 17:18:19 +00:00
Sébastien Deleuze
df1bec9e97 Polishing
See gh-31974
2024-01-08 12:23:23 +01:00
Sébastien Deleuze
cfec88bfa8 Add CORS support for Private Network Access
This commit adds CORS support for Private Network Access
by adding an Access-Control-Allow-Private-Network response
header when the preflight request is sent with an
Access-Control-Request-Private-Network header and that
Private Network Access has been enabled in the CORS
configuration.

See https://developer.chrome.com/blog/private-network-access-preflight/
for more details.

Closes gh-31974

(cherry picked from commit 318d460256)
2024-01-08 11:49:00 +01:00