Commit Graph

5475 Commits

Author SHA1 Message Date
rstoyanchev f5b5f9a639 Fix forwarded host formatting
Follow-up to recent commit
75e2e2c3c7

Closes gh-34253
2025-01-28 15:53:14 +00:00
rstoyanchev 52c187bf64 Merge branch '6.2.x' 2025-01-28 15:37:38 +00:00
rstoyanchev 9b58df8857 Update HandlerMethod#createWithResolvedBean
Avoid re-creating the instance unless it is a bean name that
needs to be resolved through the BeanFactory.

Closes gh-34277
2025-01-28 15:36:26 +00:00
Sébastien Deleuze db3c2b39b1 Remove HttpHeaders#asMultiValueMap usages from Kotlin tests
Closes gh-34327
2025-01-27 15:57:54 +01:00
Sam Brannen 5574f45cb1 Merge branch '6.2.x' 2025-01-27 15:22:10 +01:00
Sam Brannen 34d6dd9b62 Polishing 2025-01-27 15:19:00 +01:00
Sébastien Deleuze 1167b30b3f Merge branch '6.2.x' 2025-01-27 15:07:59 +01:00
Sébastien Deleuze 5499878de0 Support properties in kotlinx.serialization converters
This commit adds support for Kotlin properties in Spring WebMVC
controllers, supported for reasons explained in gh-31856, with
kotlinx.serialization converters.

Closes gh-34284
2025-01-27 15:06:57 +01:00
Sébastien Deleuze a970fc16aa Support properties in kotlinx.serialization codecs
This commit adds support for Kotlin properties in Spring WebFlux
controllers, supported for reasons explained in gh-31856, with
kotlinx.serialization codecs.

See gh-34284
2025-01-27 15:06:50 +01:00
Sébastien Deleuze 7f21443a1b Refine null-safety based on IDEA warnings
See gh-28797
2025-01-22 13:20:11 +01:00
Brian Clozel f85752a956 Fix hints and predicates for Field reflective access
This commit revisits the arrangement for Field hints after changes made
in gh-34239.

Closes gh-34294
2025-01-21 20:05:12 +01:00
rstoyanchev 92472a6b62 Merge branch '6.2.x' 2025-01-21 12:23:05 +00:00
rstoyanchev 233f755416 Update Javadoc that links to RestTemplate
Ensure RestClient is mentioned where appropriate.

Closes gh-34270
2025-01-21 12:21:22 +00:00
rstoyanchev b026680e1c Enhance DisconnectedClientHelper exception type checks
We now look for the target exception types in cause chain as well,
but return false if we encounter a RestClient or WebClient
exception in the chain.

Closes gh-34264
2025-01-21 12:21:22 +00:00
rstoyanchev e47cc19964 Restore exception phrase in DisconnectedClientHelper
Effectively revert 203fa7, and add implementation comment and tests.

See gh-34264
2025-01-21 12:21:22 +00:00
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 eb15b26abe Add since and forRemoval to @Deprecated 2025-01-16 15:47:52 +00:00
rstoyanchev 5f6df35ec4 Remove deprecated LastModified APIs
See gh-33809
2025-01-16 15:47:45 +00:00
Sébastien Deleuze 94e3b54581 Fix the build
This commit add missing compileOnly jsr305 dependencies.
2025-01-16 08:11:49 +01: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 5150a9a6ad Polishing contribution
Closes gh-34230
2025-01-15 18:31:50 +00:00
Yanming Zhou a8c5885aff Fix wrong document about RequestHeaderArgumentResolver
Also test is added to verify that.

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>

See gh-34230
2025-01-15 18:31:49 +00:00
rstoyanchev 3b1d14a64d Fix checkstyle warning
See gh-34253
2025-01-15 18:13:42 +00:00
rstoyanchev 75e2e2c3c7 Consistent formatting of forward for host
Closes gh-34253
2025-01-15 17:53:30 +00:00
rstoyanchev 4920086225 Remove deprecated web APIs
See gh-33809
2025-01-15 16:26:16 +00:00
rstoyanchev 83c020eea5 Remove deprecated HttpStatus codes
See gh-33809
2025-01-15 16:26:16 +00:00
rstoyanchev 9f77d5ff1f Remove deprecated ThemeResolver support
See gh-33809
2025-01-15 16:26:16 +00:00
rstoyanchev 9ddbf800b9 Remove deprecated APIs in spring-web
See gh-33809
2025-01-15 16:26:16 +00:00
Simon Baslé caf84ffe7d Revisit HttpHeadersAssert after HttpHeaders API changes
- add various assertions to HttpHeadersAssert
 - improve assertion test coverage
 - remove niche size assertions

Closes gh-34168

Co-authored-by: Stephane Nicoll <stephane.nicoll@broadcom.com>
2025-01-15 11:42:59 +01:00
Sébastien Deleuze 380c9e318c Specify generic type nullness in spring-web
See gh-34140
2025-01-14 12:35:02 +01:00
Brian Clozel d28c0396c9 Update runtime hints predicates after GraalVM changes
As of gh-33847, method and field introspection is included by default
when a type is registered for reflection.
Many methods in ReflectionHintsPredicates are now mostly useless as their
default behavior checks for introspection.

This commit deprecates those methods and promotes instead invocation
variants. During the upgrade, developers should replace it for an
`onType` check if only reflection is required. If they were checking for
invocation, they should use the new 'onXInvocation` method.

Closes gh-34239
2025-01-13 15:34:34 +01:00
Stéphane Nicoll 7c4351ab0a Polish
See gh-34231
2025-01-11 12:35:42 +01:00
Brian Clozel f2a18e5920 Upgrade to Jetty 12.1.0.alpha0
Closes gh-34237
2025-01-10 18:03:10 +01:00
rstoyanchev 39bb751546 Polishing 2025-01-10 14:39:24 +00:00
rstoyanchev be5542a7a7 Add buffering predicate to RestTemplate
See gh-33785
2025-01-10 14:39:24 +00:00
Sébastien Deleuze ec48c47886 Make URI template variables nullable
Closes gh-34221
2025-01-10 11:39:21 +01:00
rstoyanchev 07455b10f3 Use response decorator to check if error handled
Closes gh-34231
2025-01-10 10:51:39 +01:00
rstoyanchev a72855b2b3 DefaultResponseErrorHandler updates
Deprecate handleError(response), and ensure it continues to be invoked
if overridden.

See gh-34231
2025-01-10 10:51:11 +01:00
rstoyanchev cdddf09c20 Polishing in DefaultResponseErrorHandler
See gh-34231
2025-01-10 10:50:41 +01:00
rstoyanchev 82941caa00 Polishing in DefaultRestClientBuilder
Align order of fields with order of methods on Builder.
2025-01-08 15:52:40 +00:00
rstoyanchev 4b9be5aaf8 Add setBody with byte[] to StreamingHttpOutputMessage
Sometimes the content to write is already buffered, but requires boilerplate
to write through a Body callback.

See gh-33785
2025-01-08 15:52:40 +00:00
rstoyanchev 819a13f22d Apply predicate to BufferingClientHttpRequestFactory
The bufferingPredicate configured in RestClient.Builder can and should also
be used in the (existing) shouldBuffer protected method in
BufferingClientHttpRequestFactory since the factory is no longer intended
for direct use, and in any case the setting should apply in all cases
including when there are no interceptors.

See gh-33785
2025-01-08 15:52:40 +00:00
rstoyanchev 27c4f0e29d Built-in buffering support in RestClient
Closes gh-33785
2025-01-08 13:46:15 +00:00
rstoyanchev 6a0c5ddf68 Refactoring in AbstractBufferingClientHttpRequest
Extract a protected method for subclasses to use to perform the
actual (end-of-chain) request execution.

See gh-33785
2025-01-08 13:46:15 +00:00
rstoyanchev b9efa91ecc Polishing in client tests 2025-01-08 13:46:15 +00:00
rstoyanchev 3f7d3cbbd3 Add chaining methods to ClientHttpRequestInterceptor
See gh-34169
2025-01-08 13:46:15 +00: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
Brian Clozel e8e722fb59 Allow multiple executions of ClientHttpRequestInterceptors
Prior to this commit, an `ClientHttpRequestInterceptor` implementation
could delegate HTTP calls to the next `ClientHttpRequestExecution` only
once. Calling the execution would advance to the next interceptor in the
chain in a mutable fashion for the entire lifetime of the current
exchange.

This commit changes the implementation of `InterceptingClientHttpRequest`
so that a `ClientHttpRequestInterceptor` implementation can call
`ClientHttpRequestExecution#execute` multiple times.

This is especially useful for interceptors in case they want to issue
other HTTP requests without needing another `RestTemplate` or
`RestClient` instance provided out of band.

Closes gh-34169
2025-01-06 19:29:09 +01:00