Commit Graph

5402 Commits

Author SHA1 Message Date
Johnny Lim 3c40e5e501 Add Javadoc since for HandlerMethod(HandlerMethod, Object, boolean)
See 56c4d2d

Closes gh-34431
Signed-off-by: Johnny Lim <izeye@naver.com>
2025-02-16 12:10:01 +01:00
Brian Clozel 689782cbad Make ProblemDetail Serializable
This commit makes the `ProblemDetail` type implement `Serializable` in
order to be serialized and shared in distributed systems.

Closes gh-34409
2025-02-11 22:33:05 +01:00
Sam Brannen 124b38450b Remove unused code and improve assertion
See gh-34363
2025-02-11 16:30:52 +01:00
rstoyanchev d04883f839 HTTP Interface client handles query param with ":"
Closes gh-34364
2025-02-11 11:11:05 +00:00
rstoyanchev 7a0fe7d14f WebAsyncManager wraps disconnected client errors
If the Servlet container delegates a disconnected client error via
AsyncListener#onError, wrap it as AsyncRequestNotUsableException
for more targeted and consistent handling of such errors.

Closes gh-34363
2025-02-10 11:14:21 +00:00
Andras Dobrosi 2b4c7d09b0 Match ContentDisposition attributes case-insensitively
This commit ensures that `ContentDisposition` parses attributes like
"filename" and "filename*" in a case insensitive fashion, per RFC 6266.

Closes gh-34383

Signed-off-by: Andras Dobrosi <dobrosi@gmail.com>
[brian.clozel@broadcom.com: apply code conventions]
Signed-off-by: Brian Clozel <brian.clozel@broadcom.com>
2025-02-10 09:21:02 +01:00
rstoyanchev 1d7cb4fc13 Defer initialization of HandlerMethod validation flags
Re-create the HandlerMethod only after the original is used as a key
in the CORS lookup map.

Closes gh-34379
2025-02-07 13:20:16 +00:00
rstoyanchev 56c4d2d4ca Improve HandlerMethod#resolvedFromHandlerMethod initialization
Ensure the original instance is always the one returned no matter how
many times the HandlerMethod is re-created.

Make the constructor protected to allow subclasses to re-create the
HandlerMethod as the concrete subclass.

See gh-34375
2025-02-07 13:10:55 +00:00
rstoyanchev 3898482d3f Revert commit 0f38c28e91
The fix is not how the issue needs to be addressed.

See gh-34121
2025-02-05 14:26:12 +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
Sam Brannen 34d6dd9b62 Polishing 2025-01-27 15:19:00 +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
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
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
Stéphane Nicoll 7c4351ab0a Polish
See gh-34231
2025-01-11 12:35:42 +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
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
rstoyanchev 6ec7dcf2c1 Synchronize in WebAsyncManager onError/onTimeout
On connection loss, in a race between application thread and onError
callback trying to set the DeferredResult and dispatch, the onError
callback must not exit until dispatch completes. Currently, it may do
so because the DeferredResult has checks to bypasses locking or even
trying to dispatch if result is already set.

Closes gh-34192
2025-01-06 12:06:43 +00:00
rstoyanchev d94e04d97a Minor refactoring in WebAsyncManager
There is no need to set the DeferredResult from WebAsyncManager in an
onError notification because it is already done from the Lifecycle
interceptor in DeferredResult.

See gh-34192
2025-01-06 12:06:43 +00:00
rstoyanchev 5a44897c55 Polishing in WebAsyncManager
See gh-34192
2025-01-06 12:06:43 +00:00
Brian Clozel d927d64c40 Improve query params in uri KeyValue with HTTP interface client
Prior to this commit, the HTTP interface client would create URI
templates and name query params like so:
"?{queryParam0}={queryParam0[0]}".
While technically correct, the URI template is further used in
observations as a KeyValue. This means that several service methods
could result in having the exact same URI template even if they produce
a different set of query params.

This commit improves the naming of query params in the generated URI
templates for better observability integration.

Closes gh-34176
2025-01-02 20:00:38 +01:00
Johnny Lim 6d86b23fbe Apply Checkstyle MethodParamPadCheck module
This commit also fixes its violations.

Closes gh-34173
2024-12-30 09:02:06 +01:00
Simon Baslé 0f38c28e91 Fix ServletRequestDataBinder ctor binding with `[]`-indexed query params
This change ensures that a request containing query parameters in the
array format `someArray[]=value` can be bound into a simple array in
constructors, even for cases where the array values don't have nested
properties.

The value resolver is directly called in the constructor case, before
any mutable properties are considered or even cleared (see
`WebDataBinder#adaptEmptyArrayIndices` method). As a result, we need to
accommodate the possibility that the request stores array elements under
the `name[]` key rather than `name`. This change attempts a secondary
lookup with the `[]` suffix if the type is a list or array, and the key
doesn't include an index.

Closes gh-34121
2024-12-27 10:59:15 +01:00
Sébastien Deleuze 69b74d7645 Fix NullPointerException in HttpComponentsClientHttpResponse
Closes gh-34132
2024-12-23 15:34:04 +01:00
Juergen Hoeller 0aa721cad0 Polishing 2024-12-11 17:52:59 +01:00
rstoyanchev 640e570583 Minor refactoring in ServerSentEvent
Extract re-usable method to serialize SSE fields.

See gh-33975
2024-12-11 16:09:22 +00:00
rstoyanchev 66f33a8265 MapMethodProcessor supportsParameter is more specific
Closes gh-33160
2024-12-11 16:09:01 +00:00
Juergen Hoeller 68997d8416 Avoid javadoc references to deprecated types/methods 2024-12-11 16:58:37 +01:00
youable 5494d78018 Polish
See gh-33891
2024-12-10 07:47:42 +01:00
Juergen Hoeller edf7f3cd43 Polishing 2024-12-04 16:41:07 +01:00
rstoyanchev 15dcc449a2 Refine Reactor Netty handling of request without body
Closes gh-34003
2024-12-02 17:52:39 +00: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
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
sonallux 986ffc2072 Use full URI for URI template keyvalue with RestClient
Prior to this commit, `RestClient` would not use the full URI created by
the uri handler as a template request attribute.
This means that HTTP client observations would not contain the base URI
in recorded observations as the uri template keyvalue.

Closes gh-33928
2024-11-21 14:23:01 +01:00
Sam Brannen f5c3f3522e Simplify @⁠EnumSource usage 2024-11-18 14:12:13 +01:00
Tran Ngoc Nhan 883254e1d0 Polish
- Update copyright header.
- Consistent use of "SIMPLE" link text for Style#SIMPLE in javadoc.

Closes gh-33883
2024-11-18 13:40:23 +01:00
Brian Clozel e919d0adcc Reflect well-known MediaTypes intent in Javadoc
Closes gh-33754
2024-11-18 11:57:22 +01:00
Brian Clozel 4aafae1c33 Reflect well-known HttpHeaders intent in Javadoc
Closes gh-33886
2024-11-18 11:57:15 +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
rstoyanchev de8a94f30d Do not set up CookieStore in Apache connector
Closes gh-33822
2024-11-14 09:30:36 +00: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
Sam Brannen d92c57f7a5 Merge branch '6.1.x' 2024-11-13 14:23:52 +01:00