Commit Graph

5820 Commits

Author SHA1 Message Date
rstoyanchev 553f289ddb Polishing contribution
Closes gh-35307
2025-08-12 06:43:10 +01:00
Phillip Webb 169b7015d2 Only add `httpServiceProxyRegistry` bean when necessary
Update `AbstractHttpServiceRegistrar` so that the
`httpServiceProxyRegistry` bean  is only added when registrations
are found.
2025-08-12 06:31:24 +01:00
Sam Brannen a65ebec3d8 Merge branch '6.2.x' 2025-08-11 11:29:03 +03:00
Sam Brannen f11a1e6f82 Polish tests 2025-08-11 11:27:10 +03:00
rstoyanchev 29521e2f8a Merge branch '6.2.x' 2025-08-08 12:31:28 +01:00
rstoyanchev ffc785471b Fix checkstyle error 2025-08-08 12:31:13 +01:00
rstoyanchev 89ba0fd6df Polishing contribution
Closes gh-35294
2025-08-08 12:08:22 +01:00
Christoph 96deb27211 Make `type` in `ProblemDetail` nullable
See gh-35294

Signed-off-by: Christoph Wagner <cwagner@dimedis.de>
Signed-off-by: Christoph <cwagner@dimedis.de>
2025-08-08 11:54:03 +01:00
rstoyanchev a0542f023c Merge branch '6.2.x' 2025-08-08 11:50:58 +01:00
rstoyanchev 6e2fbfe108 Polishing contribution
Closes gh-35232
2025-08-08 11:50:07 +01:00
秦利斌 968e037503 Add documentation of RequestMapping about SpEL
Signed-off-by: 秦利斌 <68638598+Allan-QLB@users.noreply.github.com>
2025-08-08 11:37:25 +01:00
rstoyanchev f0a9f649c1 Allow null in ProblemDetail#type
See gh-35294
2025-08-08 11:36:53 +01:00
rstoyanchev 600d6c6fc0 Update contribution
Closes gh-34721
2025-08-08 11:31:21 +01:00
giampaolo 7a55ce48a9 Handle CancellationException in JdkClientHttpRequest
Handle CancellationException in order to throw an HttpTimeoutException
when the timeout handler caused the cancellation.

See gh-34721

Signed-off-by: giampaolo <giampaorr@gmail.com>

fix: use timeoutHandler with a flag isTimeout

    Closes gh-33973

    Signed-off-by: giampaolo <giampaorr@gmail.com>
2025-08-08 11:31:21 +01:00
Juergen Hoeller 573c5d96b9 Merge branch '6.2.x'
# Conflicts:
#	spring-aop/src/main/java/org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor.java
2025-08-06 19:03:14 +02:00
Juergen Hoeller 5df9fd4eff Polishing (aligned with main) 2025-08-06 19:01:18 +02:00
rstoyanchev 2b1a815167 Add supportedVersionPredicate to ApiVersionConfigurer
Closes gh-35267
2025-08-01 12:35:18 +01:00
rstoyanchev 87838aa4c5 PathApiVersionResolver is not nullable
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
Closes gh-35265
2025-07-31 15:32:12 +01:00
rstoyanchev da361699a4 Add MediaType parameter to ApiVersionInserter
Closes gh-35259
2025-07-31 15:32:12 +01:00
rstoyanchev 08ccf46399 Rename request param version strategy to query param
Closes gh-35263
2025-07-31 15:32:12 +01:00
rstoyanchev c8b2a0f830 Rename HttpServiceClientRegistrarSupport
to AbstractClientHttpServiceRegistrar since it is a registrar and
an extension of Abstract[HttpServiceRegistrar]. Also, a more
friendly name for use in application configuration.

See gh-35244
2025-07-31 05:22:44 +01:00
rstoyanchev 9dbe304cf6 Revise method order in AbstractHttpServiceRegistrar
See gh-35244
2025-07-31 05:22:29 +01:00
rstoyanchev 0fc9e4ec1c Exclude HttpServiceClient from GroupRegistry scan
The detect methods in the GroupRegistry that find all interfaces
with HttpExchange annotations now exclude HttpServiceClient
interfaces that are instead supported by a dedicated registrar.

This ensures there is no overlap between the HttpServiceClient
registrar scan and the ImportHttpServices registrar scan or
the scan of any other custom registrar.

See gh-35244
2025-07-31 05:22:06 +01:00
rstoyanchev 279bce7124 Add HttpServiceClient and registrar
See gh-35244
2025-07-30 13:27:12 +01:00
rstoyanchev da443020e0 Rename AnnotationHttpServiceRegistrar
Align with the name of the import annotation.
In preparation of adding a client annotation with another registrar.

See gh-35244
2025-07-30 13:27:12 +01:00
Patrick Strawderman 24e66b63d1 Refine StringUtils#uriDecode and update documentation
Backport Bot / build (push) Has been cancelled Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
Deploy Docs / Dispatch docs deployment (push) Has been cancelled Details
Build and Deploy Snapshot / Verify (push) Has been cancelled Details
Refine the StringUtils#uriDecode method in the following ways:
- Use a StringBuilder instead of ByteArrayOutputStream, and only decode
  %-encoded sequences.
- Use HexFormat.fromHexDigits to decode hex sequences.
- Decode to a byte array that is only allocated if encoded sequences are
  encountered.

This commit adds another optimization mainly for the use case where
there is no encoded sequence, and updates the Javadoc of both
StringUtils#uriDecode and UriUtils#decode to match the implementation.

Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com>
Co-Authored-by: Sebastien Deleuze <sebastien.deleuze@broadcom.com>

Closes gh-35253
2025-07-29 21:44:26 +02:00
Brian Clozel d06255214e Support wildcard path elements at the start of path patterns
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
Prior to this commit, the `PathPattern` and `PathPatternParser` would
allow multiple-segments matching and capturing with the following:

* "/files/**" (matching 0-N segments until the end)
* "/files/{*path}" (matching 0-N segments until the end and capturing
  the value as the "path" variable)

This would be only allowed as the last path element in the pattern and
the parser would reject other combinations.

This commit expands the support and allows multiple segments matching at
the beginning of the path:

* "/**/index.html" (matching 0-N segments from the start)
* "/{*path}/index.html" (matching 0-N segments until the end and capturing
  the value as the "path" variable)

This does come with additional restrictions:

1. "/files/**/file.txt" and "/files/{*path}/file.txt" are invalid,
   as multiple segment matching is not allowed in the middle of the
   pattern.
2. "/{*path}/files/**" is not allowed, as a single "{*path}" or "/**"
   element is allowed in a pattern
3. "/{*path}/{folder}/file.txt"  "/**/{folder:[a-z]+}/file.txt" are
   invalid because only a literal pattern is allowed right after
   multiple segments path elements.

Closes gh-35213
2025-07-25 13:24:18 +02:00
Sébastien Deleuze ed2cad3af0 Merge branch '6.2.x'
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Has been cancelled Details
Deploy Docs / Dispatch docs deployment (push) Has been cancelled Details
Build and Deploy Snapshot / Verify (push) Has been cancelled Details
2025-07-23 16:30:12 +02:00
Sébastien Deleuze 5e338ef1b8 Make MessageSource locale parameter nullable
Backport Bot / build (push) Has been cancelled Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
Deploy Docs / Dispatch docs deployment (push) Has been cancelled Details
Build and Deploy Snapshot / Verify (push) Has been cancelled Details
Closes gh-35230
2025-07-23 16:02:38 +02:00
Juergen Hoeller 28471c33ae Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
#	spring-web/src/main/java/org/springframework/http/server/observation/DefaultServerRequestObservationConvention.java
#	spring-web/src/main/java/org/springframework/http/server/reactive/observation/DefaultServerRequestObservationConvention.java
2025-07-15 21:26:38 +02:00
Juergen Hoeller 54732605a5 Backport nullability refinements for Micrometer
See gh-35170
2025-07-15 20:56:36 +02:00
Juergen Hoeller eac490d320 Upgrade to Reactor 2025.0.0-M5 and Micrometer 1.16.0-M1
Includes Netty 4.2.3

Closes gh-35169
Closes gh-35170
2025-07-15 20:40:59 +02:00
rstoyanchev e3f1bc8422 Allow resolution of optional HandlerMethod
Closes gh-35067
2025-07-15 15:39:49 +01:00
Sébastien Deleuze 19086835a7 Upgrade tests to OkHttp 5.x
See https://square.github.io/okhttp/changelogs/changelog/#version-500.

Closes gh-35183
2025-07-15 16:20:07 +02:00
Juergen Hoeller b76e748ecf Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-07-15 16:01:21 +02:00
Juergen Hoeller f86034b528 Drop final declaration from doFilter entry point (for CGLIB proxying)
Closes gh-35198
2025-07-15 15:59:23 +02:00
Brian Clozel ad007caebc Refine multipart converter registration in HttpMessageConverters
As of #33894, `HttpMessageConverters` auto-detects converters and use
custom-provided ones to configure a collection of converters for the
client or the server.
Right now the multipart converter is only configured if core converters
(JSON, XML...) are configured/detected. We do not reuse the base
converters (resource, string, byte array) for the multipart converter
as it applies different encoding defaults (ISO for the main ones, UTF-8
for multipart).

This commit refines the configuration to not only include the multipart
converter when core converters are present, but also if any other
converter was configured.

Closes gh-35203
2025-07-15 14:45:28 +02:00
Brian Clozel b59dca9c7f Align HttpMessageConverters builder with WebFlux codecs variants
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
As of #33894, we introduced a new `HttpMessageConverters` API.
While this achieved our goal of focusing converters classpath detection
in a single place and avoiding waste, a single `HttpMessageConverters`
instance for both client and server added more complexity for developers.

This commit aligns the API here with the WebFlux `CodecsConfigurer` to
opt for a client/server flavor as the first step in the builder.
While this make the sharing of converter instances between server and
client impossible, this allows for a simpler API and separates concerns.

Closes gh-35187
2025-07-11 17:07:28 +02:00
Brian Clozel 0a705f467d Configure custom converters ahead in HttpMessageConverters
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
This commit aligns `HttpMessageConverters` with the WebFlux codecs
configuration by adding custom converters first, before the
auto-detected and well-known ones.

This is a general approach in Spring Framework, where custom
implementations are more likely to handle specific uses cases and should
be involved before considering the more general implementations.

Fixes gh-35177
2025-07-10 16:56:06 +02:00
Sébastien Deleuze b8015d87ef Use flexible generics nullness in RestClient ExchangeFunction
Closes gh-35180
2025-07-10 10:39:51 +02:00
rstoyanchev c23edae4db HttpRequestValues.Processor exposes MethodParameter[]
Closes gh-35148
2025-07-09 10:54:46 +01:00
Yanming Zhou 410a9ce108 Mark applicable Scope's methods as default
Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-07-07 13:37:47 +02:00
rstoyanchev 1982c7e020 Support 404 handling for HttpExchange interfaces
Closes gh-32105
2025-07-07 09:12:22 +01:00
rstoyanchev 340468cf4b Use toString for WebFilter checkpoint
Closes gh-34702
2025-07-07 09:12:22 +01:00
Sam Brannen 769ba9e23b Merge branch '6.2.x'
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
2025-06-29 17:42:35 +02:00
Sam Brannen 1ad05db877 Simplify dependency management for JUnit artifacts
Backport Bot / build (push) Waiting to run Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
This commit simplifies our dependency management for JUnit artifacts by
making use of the junit-jupiter and junit-platform-suite aggregator
artifacts.

Closes gh-35127
2025-06-29 17:42:22 +02:00
Sam Brannen 5513139ef5 Clean up warnings and revise for consistency 2025-06-29 16:47:53 +02:00
rstoyanchev 5a6c019413 Support for functional routing by API version
See gh-35113
2025-06-27 16:22:44 +01:00
rstoyanchev 224f1af08e Prepare to support API versioning for fn
Add default method to resolve, parse, and validate version
Simplify tests
2025-06-27 16:22:44 +01:00
Brian Clozel da124a9e89 Make HttpMessageConverters classpath detection static
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
Prior to this commit, the classpath detection of various
`HttpMessageConverter` types was using an instance `ClassLoader`. The
main goal here was to provide the feature and being able to test it with
filtered classloaders.

It seems this approach fails with GraalVM and we need to ensure that
classpath detection is performed at class loading time for our GraalVM
feature (inlining such static booleans at build time).
As a result, we need to remove the tests for classpath detection.

See gh-33894
2025-06-27 10:10:40 +02:00
Brian Clozel 7e919d2c96 Reorder multipart converter for server converters
Closes gh-33894
2025-06-27 09:30:34 +02:00
Brian Clozel beedf0a76b Use HttpMessageConverters in client and server config
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
This commit uses the new `HttpMessageConverters` class for the HTTP
client (`RestTemplate` and `RestClient`) and HTTP server support.

This effectively removes the duplication of classpath detection for
message converters in multiple places: clients, server and the multipart
converter itself.
Instead of creating multiple instances of the same converters, this
allows applications to share converter instances as much as possible for
better memory efficiency.

As a result, this change also deprecates configuration methods in the
MVC support that are superseded by the new methods introduced for
`HttpMessageConverters` support.

Closes gh-33894
2025-06-26 17:19:33 +02:00
Brian Clozel 1af25e9cb1 Add HttpMessageConverters
Prior to this commit, Spring Web would configure
`HttpMessageConverter<?>` collections on clients like `RestTemplate` and
on the server infrastructure, in `WebMvcConfigurationSupport`.

This commit introduces a high-level construct for building and
configuring ordered collections of converters.

This includes:
* configuration of well-known converters with classpath detection
* configuration of shared converters, or client/server specific
* configuration of custom converters

See gh-33894
2025-06-26 17:19:33 +02:00
rstoyanchev e508dea82d Merge branch '6.2.x' 2025-06-25 12:45:04 +01:00
rstoyanchev f84552a97e Polishing contribution
Backport Bot / build (push) Waiting to run Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
Closes gh-35102
2025-06-25 12:37:42 +01:00
Daniil Razorenov 8d6117e419 Support StreamingHttpOutputMessage in RestClient
This commit allows RestClient to handle StreamingHttpOutputMessage
properly by checking the type of the request and invoking setBody()
when appropriate. This improves interoperability with components that
expect streamed output.

A new integration test has been added to verify the functionality.

See gh-35102

Signed-off-by: Daniil Razorenov <daniltmb@gmail.com>
2025-06-25 12:36:32 +01:00
rstoyanchev 482cfb0b18 Add detectSupportedVersions in spring-webmvc
Closes gh-35105
2025-06-25 12:03:35 +01:00
rstoyanchev 785aab8ad5 Rename ApiDeprecationHandler to insert "Version"
The name is a bit long, but it is necessary to indicate it's a handler
for a deprecation version, and the decision is based on the version,
not an individual endpoint.

See gh-35049
2025-06-25 12:03:35 +01:00
rstoyanchev ffdf941219 Resolve API version in RequestMappingHandlerMapping
API version resolution and parsing is already applied as long as
an ApiVersionStrategy is configured and irrespective of whether
a given RequestMapping has a version or not.

RequestMappingHandlerMapping also needs to be aware of the API version
in order to apply deprecated version handling. So it is better to
resolve, parse, and validate the version in the beginning of
handler mapping rather than in the first call to any
VersionRequestCondition.

Closes gh-35049
2025-06-23 18:03:56 +01:00
rstoyanchev 492e51f3ba Add handling of deprecated API versions
See gh-35049
2025-06-23 18:03:56 +01:00
rstoyanchev 5d34f9c87e Support API versioning via MediaType parameter
Closes gh-35050
2025-06-23 18:03:55 +01:00
Sam Brannen 12146c4a1b Clean up warning in Gradle build
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Has been cancelled Details
Deploy Docs / Dispatch docs deployment (push) Has been cancelled Details
Build and Deploy Snapshot / Verify (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
Update Antora UI Spring / Update on Supported Branches (6.1.x) (push) Has been cancelled Details
Update Antora UI Spring / Update on docs-build (push) Has been cancelled Details
2025-06-20 16:43:36 +02:00
Sam Brannen 7ffd4e7cf8 Sync test fixture MockServerHttpRequest implementation with original 2025-06-20 16:33:28 +02:00
Sam Brannen f478f5cdc8 Introduce factory methods in SslInfo and remove MockSslInfo
After further consideration, we have decided to remove the recently
introduced MockSslInfo in favor of introducing the following static
factory methods directly in the SslInfo interface.

- SslInfo.from(String sessionId)

- SslInfo from(String sessionId, X509Certificate... peerCertificates)

See gh-35042
See gh-35078
2025-06-19 13:39:31 +02:00
rstoyanchev a2b90d9e9a Add HttpExchangeAdapter decoration
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
Closes gh-35059
2025-06-18 15:32:40 +01:00
Sam Brannen 0e84761871 Return Builder from sslInfo() builder method for MockServerHttpRequest
Prior to this commit, the sslInfo() method in MockServerHttpRequest's
BaseBuilder returned void, which prevented it from being used with the
intended fluent Builder pattern.

This commit changes the return type to the builder (B) for proper method
chaining.

Closes gh-35075
2025-06-18 13:19:43 +02:00
WonYong Hwang 5d0fc72eb2
Document intention of toString() in HandlerMethod
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
Document that HandlerMethod.toString() is used in log and error messages,
and that the returned description should typically include the method
signature of the underlying handler method for clarity and debugging.

Closes gh-35055

Signed-off-by: WonYong Hwang <111210881+wonyongg@users.noreply.github.com>
Co-authored-by: Sam Brannen <104798+sbrannen@users.noreply.github.com>
2025-06-18 13:00:44 +02:00
Brian Clozel 0202d79232 Merge branch '6.2.x'
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
2025-06-17 17:19:35 +02:00
Brian Clozel 45d887f973 Fix missing request body for GET and DELETE JdkClientHttpRequest
Backport Bot / build (push) Waiting to run Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
This commit fixes a regression introduced in gh-34971 where GET and
DELETE requests would not allow request bodies anymore for
`JdkClientHttpRequest`.
We are now using `builder.GET()` and `builder.DELETE()` methods only if
the provided body is null.

Fixes gh-35068
2025-06-17 17:19:21 +02:00
Spring Builds 16edf9867a Update copyright headers in source files
This commit updates Java, Kotlin, and Groovy source files to use the
"<year>-present" pattern in copyright headers.

Closes gh-35070
2025-06-17 16:23:50 +02:00
Spring Builds aee29b7f30 Update copyright headers in source files
This commit updates Java, Kotlin, and Groovy source files to use the
"<year>-present" pattern in copyright headers.

Closes gh-35070
2025-06-17 15:54:58 +02:00
Johnny Lim cd5e4c2264 Fix typo in ProtobufHttpMessageConverterTests.canWrite()
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
See gh-34645
Closes gh-35062

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-06-16 18:40:32 +02:00
Brian Clozel 764d35c072 Merge branch '6.2.x' 2025-06-16 15:54:43 +02:00
Brian Clozel 696692f1ed Do not attempt to decode wildcard content-types as form-data
Backport Bot / build (push) Waiting to run Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
Prior to this commit, the `DefaultServerWebExchange` would attempt to
decode request bodies as form-data or multipart of the request
content-type was compatible with the expected media types.

If requests are sent with an invalid wildcard content-type such as "*/*"
or "multipart/*", we should not attempt to decode here.

Fixes gh-34660
2025-06-16 15:51:47 +02:00
Brian Clozel af7758cbc7 Configure CheckStyle rule for empty catch blocks
This commit configures a new CheckStyle rule that fails for empty
"catch" blocks, unless the exception is named "ignored" or "expected".

This also fixes the remaining instances missed by the previous commit.

Closes gh-35047
2025-06-15 16:11:48 +02:00
Vincent Potucek 0d4dfb6c1f Rename exception variables in empty catch blocks
The Spring codebase sometimes ignores exceptions in catch blocks on
purpose. This is often called out by an inline comment.
We should make this more obvious by renaming the exception argument in
the catch block to declare whether the exception is "ignored" or
"expected".

See gh-35047

Signed-off-by: Vincent Potucek <vpotucek@me.com>
[brian.clozel@broadcom.com: rework commit message]
Signed-off-by: Brian Clozel <brian.clozel@broadcom.com>
2025-06-15 16:11:42 +02:00
Brian Clozel 3da645f4b9 Merge branch '6.2.x'
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
2025-06-13 16:57:26 +02:00
rstoyanchev 00cc48dad4 Support repeatable multipart write
Closes gh-34859
2025-06-13 15:50:22 +01:00
Brian Clozel 8dee7d8fb6 Use concrete form-data type when reading request body
Backport Bot / build (push) Waiting to run Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
Prior to this commit, the WebFlux server support would try reading
form-data from the request by:

* first, checking that request content-type is compatible with a
  form-data content-type
* then by selecting a message reader that is compatible with the given
  request content-type

This approach is flawed because if the content-type provided by the
request is too broad, another message reader could be selected that's
not meant to be used for reading form-data. Typically, a JSON message
reader could be selected and would fail when reading the request.
This problem was previously hidden because message readers would not
support `MultiValueMap` as a target type. Now that some readers support
this type, this can lead to deserialization errors.

This commit now ensures that in all cases, we attempt to read form-data
with a message reader that supports the
"application/x-www-form-urlencoded" media type.

Fixes gh-34660
2025-06-13 16:45:46 +02:00
Stéphane Nicoll 8bf9e0cbff Polish "Add hints to instantiate HttpService group adapters"
See gh-35038
2025-06-12 21:24:58 +02:00
Olga Maciaszek-Sharma 8142f80581 Add hints to instantiate HttpService group adapters
See gh-35038

Signed-off-by: Olga Maciaszek-Sharma <olga.maciaszek-sharma@broadcom.com>
2025-06-12 21:23:35 +02:00
Brian Clozel f11235ee19 Merge branch '6.2.x' 2025-06-12 08:53:02 +02:00
Brian Clozel f0e7b42704 Encode non-printable character in Content-Disposition parameter
Backport Bot / build (push) Waiting to run Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
Prior to this commit, the "filename" parameter value for the
"Content-Disposition" header would contain non-printable characters,
causing parsing issues for HTTP clients.
This commit ensures that all non-printable characters are encoded.

Fixes gh-35034
2025-06-12 08:39:29 +02:00
Brian Clozel a462f5e853 Merge branch '6.2.x' 2025-06-11 17:41:53 +02:00
Johnny Lim e86dc9ad95 Apply gh-34856 to MockClientHttpRequest in testfixture package
Backport Bot / build (push) Waiting to run Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
Closes gh-35031

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-06-11 17:40:54 +02:00
Sam Brannen 2c0f01e8ed Merge branch '6.2.x'
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
2025-06-10 11:52:37 +02:00
Sam Brannen 4d2cc4ae97 Polish contribution
Backport Bot / build (push) Waiting to run Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
See gh-35013
2025-06-10 11:45:20 +02:00
Mohammad Saeed Nouri c04902fefb Allow update of existing WebSession after max sessions limit is reached
Previously, when saving a WebSession, the system did not check whether
the session ID already existed. As a result, even if the session being
saved was an update to an existing one, it was incorrectly treated as a
new session, and a "maximum sessions exceeded" error was triggered.

This fix ensures that if a WebSession with the same ID already exists,
it will be updated rather than counted as a new session, thereby
preventing unnecessary session limit violations.

Closes gh-35013

Signed-off-by: Mohammad Saeed Nouri <msnsaeed71@gmail.com>
2025-06-10 11:44:59 +02:00
Sam Brannen 3c265e1044 Fix InMemoryWebSessionStoreTests.startsSessionImplicitly() test 2025-06-10 11:44:00 +02:00
Sam Brannen 222702f750 Polish WebSession support and tests 2025-06-10 11:43:56 +02:00
Sam Brannen 077146d636 Merge branch '6.2.x'
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
2025-06-09 14:12:45 +02:00
Sam Brannen 18d6a55e3e Polishing and removal of "this." for method invocations
Backport Bot / build (push) Waiting to run Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
2025-06-09 14:10:30 +02:00
Sam Brannen 5752585bb2 Clean up warnings in build 2025-06-07 12:37:27 +02:00
rstoyanchev 6c27dbc095 Merge branch '6.2.x' 2025-06-06 15:28:43 +01:00
rstoyanchev 4782c697b8 Improve RestControllerAdvice documentation
Closes gh-34866
2025-06-06 15:28:28 +01:00
rstoyanchev de52090959 Polishing contribution
Closes gh-34554
2025-06-06 15:28:28 +01:00
Vedran Pavic 4d862b871d Improve Javadoc for @ExceptionHandler
This commit adds `ProblemDetail` and `ErrorResponse` to the list of
supported return types for `@ExceptionHandler` methods.

Closes gh-34554

Signed-off-by: Vedran Pavic <vedran@vedranpavic.com>
2025-06-06 15:28:28 +01:00
Sam Brannen 87c0655e12 Polishing 2025-06-06 15:01:44 +02:00
Sam Brannen ad2931b51f Migrate away from AssertJ's catchThrowable()
Closes gh-35003
2025-06-06 15:01:26 +02:00
Sam Brannen 3aa3b81e1c Update copyright headers
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
2025-06-06 13:49:23 +02:00