Commit Graph

5820 Commits

Author SHA1 Message Date
rstoyanchev ba0de1edce Merge branch '6.2.x' 2025-09-25 12:22:29 +01:00
rstoyanchev e9fb5eb38a Respect forwarded path in UrlHandlerFilter
Closes gh-35509
2025-09-25 12:19:56 +01:00
Manu Sridharan e834a3a80c Nullability fixes for AtomicReference variables
Closes gh-35514
Signed-off-by: Manu Sridharan <msridhar@gmail.com>
2025-09-25 07:39:44 +02:00
rstoyanchev 5a858915ea Revise parsed path handling in UrlHandlerFilter
Closes gh-35538
2025-09-24 19:08:55 +01:00
Brian Clozel 20aac6dd8d Add Gson codecs for WebFlux
This commit adds new `GsonEncoder` and `GsonDecoder` for serializing and
deserializing JSON in a reactive fashion.

Because `Gson` itslef does not support decoding JSON in a non-blocking
way, the `GsonDecoder` does not support decoding to `Flux<*>` types.

Closes gh-27131
2025-09-23 17:09:41 +02:00
Sébastien Deleuze aa272b4cd9 Upgrade to Dokka 2.1.0-Beta
Required for Java 25 support.

Closes gh-35532
2025-09-23 15:57:21 +02:00
Sébastien Deleuze c79e4e230b Reinstantiate checks for kotlin-reflect
This commit reinstantiates checks for kotlin-reflect (via static final
fields for faster Java code paths and better native code removal) which
were removed as part of gh-34275, which did not consider the
increasingly popular use cases where kotlin-stdlib is present in the
classpath as a transitive dependency in Java applications.

Closes gh-35511
2025-09-22 18:33:38 +02:00
Sébastien Deleuze 7635ac38f6 Use uppercase for classpath-related static final field names
Closes gh-35525
2025-09-22 18:32:14 +02:00
Sam Brannen 0c61ac956b Add missing @⁠Override annotations
... and suppress "serial" warnings
2025-09-22 13:20:37 +02:00
rstoyanchev e9e19f5ed7 Update references to HTTP service clients in docs
Closes gh-35522
2025-09-22 11:35:46 +01:00
Sébastien Deleuze 79738d921a Upgrade to Jackson 3.0.0-rc10
See gh-35521
2025-09-22 11:16:25 +02:00
Brian Clozel c129e8a599 Merge branch '6.2.x' 2025-09-19 17:51:33 +02:00
Brian Clozel 0cc79ba366 Catch EOFException in IntrospectingClientHttpResponse
Prior to this commit, the `IntrospectingClientHttpResponse` would try
and read the HTTP response stream in order to check for the presence of
a non-empty message body.

Developers reported that in some cases, an `EOFException` is thrown
instead of returning -1 from the `read()` method. This commit ensures
that this case is taken into account and that we report the response as
an empty body in these cases.

Closes gh-35361
2025-09-19 17:49:12 +02:00
Sébastien Deleuze da0a36bfd6 Upgrade to NullAway 0.12.10 and refine nullability
Closes gh-35492
2025-09-17 15:17:23 +02:00
rstoyanchev c7121d048c Replace X-API-Version with API-Version
Closes gh-35494
2025-09-17 11:48:49 +01:00
Sébastien Deleuze 84bd44e5de Use nullable body consistently in HttpClientErrorException
Closes gh-35482
2025-09-15 10:18:04 +02:00
rstoyanchev dd60fddaf0 Always process SSE "data:" line
ServerSentEventHttpMessageReader now always processes "data:"
lines, including empty lines, as per SSE spec.

Closes gh-35412
2025-09-10 16:22:23 +01:00
Sébastien Deleuze 563dccbbda Add debug logging when no CORS configuration
Closes gh-35314
2025-09-09 15:53:34 +02:00
Juergen Hoeller ba52164373 Provide graceful fallback for non-default NIO file systems
Closes gh-35443
2025-09-08 17:28:45 +02:00
Juergen Hoeller 27221581a1 Expose getFilePath() on Resource interface for consistent NIO support
Closes gh-35435
2025-09-08 17:03:07 +02:00
rstoyanchev 736383e6cb Remove HttpServiceClient annotation
Closes gh-35431
2025-09-08 13:56:07 +01:00
rstoyanchev 10a288c986 Polishing in StatusHandler
See gh-35391
2025-09-02 15:38:03 +01:00
Johnny Lim d32b7e9b4a Polish gh-35358
Signed-off-by: Johnny Lim <izeye@naver.com>
2025-09-02 23:13:27 +09:00
Sam Brannen 6dc5bf7634 Clean up warnings related to deprecated HttpStatus values, etc. 2025-09-02 12:50:57 +02:00
Brian Clozel 942fbf3032 Polishing contribution
Closes gh-34683
2025-09-01 11:50:22 +02:00
Mengqi Xu 7b3c4e5893 Add support for Forwarded By HTTP headers
See gh-34683

Signed-off-by: Mengqi Xu <2663479778@qq.com>
2025-09-01 11:49:59 +02:00
Brian Clozel 9979de99fd Do not decompress HTTP responses when compression disabled
This commit refines changes made in gh-35225 so as to not decompress
HTTP responses if decompression support is not enabled.

Closes gh-35225
2025-08-29 16:47:58 +02:00
rstoyanchev 441b14b0c1 Handle error responses in RestClientAdapter
Closes gh-35375
2025-08-29 16:04:45 +03:00
rstoyanchev f22d1eab23 Add createException to ConvertibleClientHttpResponse
Closes gh-35391
2025-08-29 16:04:45 +03:00
rstoyanchev 21e6d7392d Re-order methods and polishing
In StatusHandler and DefaultConvertibleClientHttpResponse.

See gh-35391
2025-08-29 16:04:45 +03:00
rstoyanchev 11cb062357 Assert versionRequired and defaultVersion
Closes gh-35387
2025-08-28 15:50:33 +03:00
rstoyanchev a7e3a438c9 Correctly apply required API version validation
Closes gh-35386
2025-08-28 15:50:33 +03:00
Brian Clozel 442a2d0ca2 Merge branch '6.2.x' 2025-08-27 13:40:41 +02:00
Brian Clozel 764336f0f2 Fix Jetty DataBufferFactory memory leak
Prior to this commit, gh-32097 added native support for Jetty for both
client and server integrations. The `JettyDataBufferFactory` was
promoted as a first class citizen, extracted from a private class in the
client support. To accomodate with server-side requirements, an extra
`buffer.retain()` call was performed.
While this is useful for server-side support, this introduced a bug in
the data buffer factory, as wrapping an existing chunk means that this
chunk is already retained.

This commit fixes the buffer factory implementation and moved existing
tests from mocks to actual pooled buffer implementations from Jetty.
The extra `buffer.retain()` is now done from the server support, right
before wrapping the buffer.

Fixes gh-35319
2025-08-27 13:36:34 +02:00
Sam Brannen 55c315eb12 Merge branch '6.2.x' 2025-08-26 11:06:24 +02:00
Sam Brannen 4903fee939 Permit @⁠Nullable value in ResponseCookie from*() factory methods
Closes gh-35377
2025-08-26 11:01:29 +02:00
Brian Clozel 18eb2a6073 Polishing contribution
Closes gh-35225
2025-08-25 19:12:24 +02:00
spicydev 4101714830 Add compression support in JdkClientHttpRequestFactory
This commit ensures that the "Accept-Encoding" header is present for HTTP
requests sent by the `JdkClientHttpRequestFactory`. Only "gzip" and
"deflate" encodings are supported.

This also adds a custom `BodyHandler` that decompresses HTTP response
bodies if the "Content-Encoding" header lists a supported variant.

This feature is enabled by default and can be disabled on the request
factory.

See gh-35225

Signed-off-by: spicydev <vivek@mirchi.dev>
[brian.clozel@broadcom.com: squash commits]
Signed-off-by: Brian Clozel <brian.clozel@broadcom.com>
2025-08-25 19:11:38 +02:00
Brian Clozel 7112efee1b Align HttpStatus with RFC9110
This commit updates the `HttpStatus` enum with the latest changes in
RFC9110:

* deprecate "413 Payload Too Large" in favor of "413 Content Too Large"
* deprecate "418 I'm a teapot" as it was meant as a joke and is now
  marked as unused
* Introduce new "421 Misdirected Request"
* deprecate "422 Unprocessable Entity" in favor of
  "422 Unprocessable Content"
* deprecate "509 Bandwidth Limit Exceeded" as it's now unassigned
* deprecate "510 Not Extended" as it's now marked as "historic"

The relevant exceptions, test matchers and more have been updated as a
result.

Closes gh-32870
2025-08-25 14:30:57 +02:00
Juergen Hoeller a46023134a Polishing 2025-08-22 21:05:16 +02:00
Sébastien Deleuze dc26aaa0ec Use JsonMapper instead of ObjectMapper when relevant
This commit updates Jackson 3 JSON support to use JsonMapper
instead of ObjectMapper in converters, codecs and view constructors.

As a consequence, AbstractJacksonDecoder, AbstractJacksonEncoder,
AbstractJacksonHttpMessageConverter and JacksonCodecSupport are
now parameterized with <T extends ObjectMapper>.

Closes gh-35282
2025-08-22 18:39:23 +02:00
Tommy Ludwig 7e45f609a2 Add test for OpenTelemetryServerRequestObservationConvention
See gh-35358
2025-08-20 16:16:23 +02:00
Tommy Ludwig 3269751887 OTel semantic conventions for HTTP server for Servlet-based instrumentation
Adds an ObservationDocumentation and ObservationConvention implementation
that follows the OpenTelemetry semantic convention for HTTP Server
metrics and spans.

See gh-35358
2025-08-20 16:16:01 +02:00
Brian Clozel fce7b3d420 Remove Undertow-specific support and testing
Undertow does not support Servlet 6.1, we need to remove compatibility
tests as well as Undertow-specific classes for WebSocket and reactive
support.

Closes gh-35354
2025-08-20 10:32:33 +02:00
Sam Brannen 68762b5f86 Merge branch '6.2.x' 2025-08-19 12:34:42 +02:00
Sam Brannen 6d710d482a Find annotation on overridden method in type hierarchy with unresolved generics
Prior to this commit, the MergedAnnotations support (specifically
AnnotationsScanner) and AnnotatedMethod did not find annotations on
overridden methods in type hierarchies with unresolved generics.

The reason for this is that ResolvableType.resolve() returns null for
such an unresolved type, which prevents the search algorithms from
considering such methods as override candidates.

For example, given the following type hierarchy, the compiler does not
generate a method corresponding to processOneAndTwo(Long, String) for
GenericInterfaceImpl. Nonetheless, one would expect an invocation of
processOneAndTwo(Long, String) to be @⁠Transactional since it is
effectively an invocation of processOneAndTwo(Long, C) in
GenericAbstractSuperclass, which overrides/implements
processOneAndTwo(A, B) in GenericInterface, which is annotated with
@⁠Transactional.

However, the MergedAnnotations infrastructure currently does not
determine that processOneAndTwo(Long, C) is @⁠Transactional since it is
not able to determine that processOneAndTwo(Long, C) overrides
processOneAndTwo(A, B) because of the unresolved generic C.

interface GenericInterface<A, B> {

    @⁠Transactional
    void processOneAndTwo(A value1, B value2);
}

abstract class GenericAbstractSuperclass<C> implements GenericInterface<Long, C> {

    @⁠Override
    public void processOneAndTwo(Long value1, C value2) {
    }
}

static GenericInterfaceImpl extends GenericAbstractSuperclass<String> {
}

To address such issues, this commit changes the logic in
AnnotationsScanner.hasSameGenericTypeParameters() and
AnnotatedMethod.isOverrideFor() so that they use
ResolvableType.toClass() instead of ResolvableType.resolve(). The
former returns Object.class for an unresolved generic which in turn
allows the search algorithms to properly detect method overrides in
such type hierarchies.

Closes gh-35342
2025-08-19 12:28:12 +02:00
Brian Clozel 0d2a0d7b9e Fix '**' parsing within a PathPattern segment
Prior to this commit, a regexp path segment ending with a double wilcard
(like "/path**") would be incorrectly parsed as a double wildcard
segment ("/**").

This commit fixes the incorrect parsing.

Fixes gh-35339
2025-08-18 10:44:15 +02:00
Sébastien Deleuze 1af95a0704 Upgrade to Jackson 3.0.0-rc8 and 2.20.0-rc1
Closes gh-35295
2025-08-13 23:03:40 +02:00
Sébastien Deleuze 0389e3e3af Revert "Use JsonMapper instead of ObjectMapper when relevant"
This reverts commit d115f36400.

See gh-35282
2025-08-12 15:21:20 +02:00
Sébastien Deleuze d115f36400 Use JsonMapper instead of ObjectMapper when relevant
This commit updates Jackson 3 support to use JsonMapper instead
of ObjectMapper in converter, codec and view constructors.

Closes gh-35282
2025-08-12 10:36:37 +02:00