Commit Graph

2250 Commits

Author SHA1 Message Date
Sébastien Deleuze 1763334180 Refine KotlinDetector usages and implementation
This commit refines KotlinDetector usages and implementation in order
to remove preliminary KotlinDetector#isKotlinReflectPresent invocations
and to ensure that KotlinDetector methods are implemented safely and
efficiently for such use case.

Closes gh-34275
2025-01-20 12:34:28 +01:00
rstoyanchev 2ed281f6a8 Remove deprecated WebFlux APIs
See gh-33809
2025-01-16 15:47:52 +00:00
rstoyanchev 6873427aa7 Merge branch '6.2.x' 2025-01-15 19:04:57 +00:00
rstoyanchev 384d2749c6 Polishing in HttpServiceMethod 2025-01-15 19:03:00 +00:00
rstoyanchev 9ddbf800b9 Remove deprecated APIs in spring-web
See gh-33809
2025-01-15 16:26:16 +00:00
Sébastien Deleuze 69bfb64dfd Specify generic type nullness in spring-webflux
See gh-34140
2025-01-14 12:35:02 +01:00
Brian Clozel f2a18e5920 Upgrade to Jetty 12.1.0.alpha0
Closes gh-34237
2025-01-10 18:03:10 +01:00
Sébastien Deleuze ec48c47886 Make URI template variables nullable
Closes gh-34221
2025-01-10 11:39:21 +01:00
Brian Clozel 7a71d7c3a8 Merge branch '6.2.x' 2025-01-08 11:19:49 +01:00
Brian Clozel 84be0d85b4 Refine location checks for PathResource
This commit ensures that checks for PathResource locations are skipped
because this resource implementation will always resolve under the
current location.

Closes gh-34167
2025-01-08 10:55:22 +01:00
Brian Clozel 774231db1e Merge branch '6.2.x' 2025-01-07 22:15:16 +01:00
Brian Clozel c971276f34 Refine default filtered headers for web data binding
Prior to this commit, HTTP request data binding had been improved to
filter out by default the "Priority" header in #34039.

This commit extends the set of filtered header names with:
"Accept", "Authorization", "Connection", "Cookie", "From", "Host",
"Origin", "Priority", "Range", "Referer", "Upgrade".

If an application wishes to let those header be bound, it will need to
configure the binder and replace the default header predicate by calling
`setHeaderPredicate`.

Closes gh-34182
2025-01-07 22:11:41 +01:00
Sébastien Deleuze 96f7d50abf Remove unneeded NullAway warning suppressions
This commit removes warning suppressions related to uber/NullAway#1113
which is now fixed.

See gh-28797
2025-01-07 09:57:56 +01:00
Brian Clozel 2cdc406e71 Merge branch '6.2.x' 2025-01-07 09:04:05 +01:00
Mattias-Sehlstedt 50b1fb0b15 Change the description for the uri client request observation
This commit describes what parts that are removed from the URI template
keyvalue.

Closes: gh-34116
Signed-off-by: Mattias-Sehlstedt <60173714+Mattias-Sehlstedt@users.noreply.github.com>
2025-01-07 09:02:25 +01:00
Sam Brannen 8bba4f641f Update copyright headers to 2025 2025-01-05 17:02:14 +02:00
Sam Brannen e26c161ae9 Clean up warnings 2025-01-03 17:42:57 +02:00
Sébastien Deleuze b332920b17 Refine null-safety in the spring-webflux module
Closes gh-34163
2024-12-26 19:14:04 +01:00
Simon Baslé f24f9a4ba4 Polishing
Javadoc links to `HttpHeaders#remove` now use the new String-based
signature.

See gh-33913
2024-12-26 10:30:46 +01:00
Simon Baslé 0c6f5d7d29 `HttpHeaders` are no longer a `MultiValueMap`
This change removes the `MultiValueMap` nature of `HttpHeaders`, since
it inherits APIs that do not align well with underlying server
implementations. Notably, methods that allows to iterate over the whole
collection of headers are susceptible to artificially introduced
duplicates when multiple casings are used for a given header, depending
on the underlying implementation.

This change includes a dedicated key set implementation to support
iterator-based removal, and either keeps map method implementations that
are relevant or introduces header-focused methods that have a similar
responsibility (like `hasHeaderValues(String, List)` and
`containsHeaderValue(String, String)`).

In order to nudge users away from using an HttpHeaders as a Map, the
`asSingleValueMap` view is deprecated. In order to offer an escape
hatch to users that do make use of the `MultiValueMap` API, a similar
`asMultiValueMap` view is introduced but is immediately marked as
deprecated.

This change also adds map-like but header-focused assertions to
`HttpHeadersAssert`, since it cannot extend `AbstractMapAssert` anymore.

Closes gh-33913
2024-12-24 14:43:51 +01:00
rstoyanchev 41a9db376d Deprecate pathExtension routing predicates
Closes gh-34103
2024-12-19 15:59:18 +00:00
Sébastien Deleuze bc5d771a06 Switch to JSpecify annotations
This commit updates the whole Spring Framework codebase to use JSpecify
annotations instead of Spring null-safety annotations with JSR 305
semantics.

JSpecify provides signficant enhancements such as properly defined
specifications, a canonical dependency with no split-package issue,
better tooling, better Kotlin integration and the capability to specify
generic type, array and varargs element null-safety. Generic type
null-safety is not defined by this commit yet and will be specified
later.

A key difference is that Spring null-safety annotations, following
JSR 305 semantics, apply to fields, parameters and return values,
while JSpecify annotations apply to type usages. That's why this
commit moves nullability annotations closer to the type for fields
and return values.

See gh-28797
2024-12-19 11:07:23 +01:00
rstoyanchev 32db1a1680 Remove WebFlux trailing slash match
See gh-34036
2024-12-17 11:14:00 +00:00
rstoyanchev 7f4da52cc5 Remove Spring MVC path extension content negotiation
See gh-34036
2024-12-17 09:49:07 +00:00
Juergen Hoeller 5cbb5d4d70 Upgrade to Hibernate ORM 7.0.0.Beta3 and Validator 9.0.0.CR1
Using relocated Maven coordinates.

See gh-33750
2024-12-15 14:37:54 +01:00
rstoyanchev 2d5943352f Merge branch '6.2.x' 2024-12-11 16:22:47 +00:00
rstoyanchev 8aeced9f80 Support header filtering in web data binding
Closes gh-34039
2024-12-11 16:11:22 +00:00
rstoyanchev 70c326ed30 Support headers in DataBinding via constructor args
Closes gh-34073
2024-12-11 16:10:08 +00:00
rstoyanchev 7b4e19c69b Make ExtendedServletRequestDataBinder public
Make it public and move it down to the annotations package alongside
InitBinderBindingContext. This is mirrors the hierarchy in Spring MVC
with the ExtendedServletRequestDataBinder. The change will allow
customization of the header names to include/exclude in data binding.

See gh-34039
2024-12-11 16:09:56 +00:00
rstoyanchev 3b95d2c449 Support Flux<ServerSentEvent<Fragment>> in WebFlux
Closes gh-33975
2024-12-11 16:09:38 +00:00
rstoyanchev d45e6ec197 Support Flux<ServerSentEvent<Fragment>> in WebFlux
Closes gh-33975
2024-12-11 12:22:56 +00:00
Sébastien Deleuze edce3029a2 Remove tests for Kotlin Script Templates
Closes gh-34030
2024-12-05 11:19:42 +01:00
Juergen Hoeller da75840712 Drop server-specific TomcatRequestUpgradeStrategy for WebFlux
StandardWebSocketUpgradeStrategy is the common replacement on Tomcat.

See gh-33744
2024-12-04 16:50:16 +01:00
Juergen Hoeller 162e533393 Merge branch '6.2.x'
# Conflicts:
#	spring-context/src/test/java/org/springframework/scheduling/concurrent/AbstractSchedulingTaskExecutorTests.java
#	spring-web/src/main/java/org/springframework/http/MediaType.java
#	spring-websocket/spring-websocket.gradle
#	spring-websocket/src/main/java/org/springframework/web/socket/messaging/WebSocketStompClient.java
#	spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/DefaultTransportRequest.java
2024-12-04 16:45:54 +01:00
Juergen Hoeller edf7f3cd43 Polishing 2024-12-04 16:41:07 +01:00
Juergen Hoeller 58c64cba2c Consistent fallback to NoUpgradeStrategyWebSocketService
Closes gh-33970
2024-12-04 16:39:41 +01:00
Juergen Hoeller 2b9010c2a2 Remove APIs marked as deprecated for removal
Closes gh-33809
2024-12-04 13:19:39 +01:00
Sébastien Deleuze ab33d715a2 Merge branch '6.2.x' 2024-11-27 16:40:05 +01:00
Sébastien Deleuze 1aede291bb Move Kotlin value class unboxing to InvocableHandlerMethod
Before this commit, in Spring Framework 6.2, Kotlin value class
unboxing was done at CoroutinesUtils level, which is a good fit
for InvocableHandlerMethod use case, but not for other ones like
AopUtils.

This commit moves such unboxing to InvocableHandlerMethod in
order to keep the HTTP response body support while fixing other
regressions.

Closes gh-33943
2024-11-27 16:39:26 +01:00
rstoyanchev 81ea35c726 Update method names in FragmentsRendering
Closes gh-33974
2024-11-27 11:21:51 +00:00
rstoyanchev 1fd0b8730b Improve Javadoc of FragmentsRendering 2024-11-26 18:27:16 +00:00
Brian Clozel f5ff84ab7b Merge branch '6.2.x' 2024-11-21 14:35:52 +01:00
Johnny Lim 1910d32405 Replace TestObservationRegistryAssert.assertThat() with Assertions.assertThat()
See https://github.com/micrometer-metrics/micrometer/pull/5551

Closes gh-33929
2024-11-21 14:35:32 +01:00
Brian Clozel f548da8a8d Temporarily ignore webflux tomcat integration tests
After our Tomcat 11 upgrade, several WebFlux integration tests with
Tomcat started failing because Tomcat considers some chunked client
requests as invalid.

While we're investigating this, this commit temporarily disables the
relevant tests.

See gh-33917
2024-11-19 18:11:24 +01:00
Brian Clozel 4b3e192ca1 Upgrade to Tomcat 11.0
This commit upgrades the baseline to Tomcat 11.0 and adapts to the
following behavior changes in Tomcat:

* the MimeHeaders#clear method has been removed
* expired cookies do not set "Max-Age=0" anymore
* responses to HEAD requests do not write the "Content-Length" header
  anymore.

Closes gh-33916
2024-11-19 18:11:24 +01:00
Simon Baslé d597d2e159 Fix WebClientIntegrationTest#applyAttributesToNativeRequest flaky test
For Reactor Netty and Reactor Netty 2 (with Netty 5), the attributes are
stored as an `Attribute` on the netty channel. Reactor Netty replaces
the channel with a static placeholder one once the request has been
processed and as such, capturing the native request in the test will
lead to asserting an attribute-less channel.

This change switches to capturing the `Attribute` itself, which is a
value-holder that can be asserted later on.

Closes gh-33909
2024-11-18 16:30:16 +01:00
Brian Clozel afef439c1f Temporarily disable flaky integration test
See gh-33909
2024-11-18 11:57:09 +01:00
Simon Baslé 35b452b458 Upgrade to Undertow 2.3.18.Final, dispatch in UndertowHttpHandlerAdapter
This ensures that the reactive handling of the request is dispatched
from the Undertow IO thread, marking the exchange as async rather than
ending it once the Undertow `handleRequest` method returns.

Closes gh-33885
2024-11-14 16:14:57 +01:00
Juergen Hoeller 25e2c1b7ce Merge branch '6.1.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
#	spring-web/src/main/java/org/springframework/http/client/reactive/JettyClientHttpConnector.java
2024-11-13 15:12:55 +01:00
Juergen Hoeller 14b9865de7 Remove ineffective JettyByteBufferIterator from WebSocket adapter
In JettyWebSocketHandlerAdapter, JettyByteBufferIterator does not actually add extra behavior (in contrast to JettyClientHttpConnector).
2024-11-13 15:10:32 +01:00