Commit Graph

5285 Commits

Author SHA1 Message Date
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
Sam Brannen
4d792d0e45 Remove mentions of Joda-Time support
Since Joda-Time support was removed in Spring Framework 6.0, this commit
removes obsolete mentions of Joda-Time in the reference guide and Javadoc.

See gh-27426
Closes gh-33881
2024-11-13 14:16:14 +01:00
Brian Clozel
5b5a072351 Merge branch '6.1.x' 2024-11-12 10:05:24 +01:00
Brian Clozel
49a63e2c37 Add tests for gh-33867
Closes gh-33867
2024-11-12 10:02:48 +01:00
ZLATAN628
5666e363d1 Fix wrong uri tag for client observation convention
Prior to this commit, a client sending a request to
"https://example.org" would record the wrong URI tag as
"/https://example.org".

This commit ensures that the scheme+host part is matched correctly in
the default client observation conventions.

See gh-33867
2024-11-12 10:02:39 +01:00
rstoyanchev
d4719493bd Empty string check after conversion in AbstractNamedValueArgumentResolver
Closes gh-33794
2024-11-08 09:21:08 +00:00
rstoyanchev
37243f44e8 Refactor cookie support for Apache HttpClient
Closes gh-33822
2024-11-08 06:30:51 +00:00
Simon Baslé
715e38c44f Merge branch '6.1.x' 2024-11-07 10:05:15 +01:00
Simon Baslé
c93af1f76d Polishing: copyright header year
See gh-33823
2024-11-07 10:04:53 +01:00
Simon Baslé
bbe90a57ba Merge branch '6.1.x' 2024-11-06 11:40:46 +01:00
Simon Baslé
9b3cb15389 Introduce HttpHeaders#headerSet to guarantee case-insensitive iteration
The `HttpHeaders#headerSet` method is intended as a drop-in replacement
for `entrySet` that guarantees a single casing for all header names
reported during the iteration, as the cost of some overhead but with
support for iterator removal and entry value-setting.

The `formatHeaders` static method is also altered to do a similar
deduplication of casing variants, but now additionally mentions
"with native header names [native name set]" if the native name set
contains casing variants.

Closes gh-33823
2024-11-06 11:11:39 +01:00
Sébastien Deleuze
7e1d6fe934 Merge branch '6.1.x' 2024-11-05 10:27:22 +01:00
Johnny Lim
0beb56a58c Fix indentation to use tabs in Kotlin source files
Closes gh-33840
2024-11-05 10:24:02 +01:00
Sam Brannen
e3301dd1c4 Merge branch '6.1.x' 2024-11-03 16:17:43 +01:00
Sam Brannen
6bd4687706 Update copyright headers
See gh-33839
2024-11-03 16:14:41 +01:00
Tran Ngoc Nhan
07b12666b4 Fix typos in Javadoc and variable names
Closes gh-33839
2024-11-03 16:13:50 +01:00
rstoyanchev
bc65f93467 Improve cancel in SubscriberInputStreamTests 2024-10-31 10:05:45 +00:00
rstoyanchev
38c88e769d Polishing in SubscriberInputStreamTests 2024-10-31 10:05:45 +00:00
Sébastien Deleuze
09d87fac57 Annotate RestClient retrieve() with @CheckReturnValue
This annotation triggers a warning in IDEs supporting
`@CheckReturnValue` when retrieve() return value is not
used.

Closes gh-33818
2024-10-30 14:45:35 +01:00
Juergen Hoeller
a1f6098158 Merge branch '6.1.x' 2024-10-29 23:04:05 +01:00