Commit Graph

4803 Commits

Author SHA1 Message Date
Stéphane Nicoll 0c42965fc3 Polish 2024-01-15 11:17:19 +01:00
rstoyanchev 47779d6a53 Double-checked lock in ChannelSendOperator#request
Closes gh-31865
2024-01-12 17:15:47 +00:00
Arjen Poutsma b16f379788 Improve RestTemplate Javadoc
See gh-32016
2024-01-12 12:52:19 +01:00
rstoyanchev 50fad9ed05 Lenient port handling in HierarchicalUriComponents#toUriString
Closes gh-32003
2024-01-10 20:59:59 +00:00
rstoyanchev e7eaaaded1 Explicit initialization of shouldValidate flags
Closes gh-32007
2024-01-10 18:13:25 +00:00
Arjen Poutsma 49d3ec58fc Use timeout for JdkClientHttpRequest response retrieval
This commit ensures that, in JdkClientHttpRequest, the response is
obtained  using a timeout, instead of blocking indefinitely.

Closes gh-31911
2024-01-10 09:53:16 +01:00
Stéphane Nicoll c4405104a8 Polish 2024-01-09 17:31:34 +01:00
Arjen Poutsma e6f638132c Create case-insensitive copy in RestClientResponseException
Closes gh-31978
2024-01-09 12:11:02 +01:00
Stéphane Nicoll 1f2d29ee08 Polish 2024-01-08 17:12:33 +01:00
Sébastien Deleuze cffc8835c6 Mention parameter-names in Jackson2ObjectMapperBuilder documentation
Closes gh-31959
2024-01-08 14:59:02 +01:00
Sébastien Deleuze bd66763f26 Polishing
See gh-28546
2024-01-08 12:27:37 +01:00
rstoyanchev 8552e149b5 Improve method validation for container elements
This change moves container element properties from ParameterErrors
to base class ParameterValidationResult, and makes that support
independent of whether violations are nested within a container
element bean or through constraints on container elements, e.g.
`List<@NotBlank String>`.

Closes gh-31887
2024-01-05 16:32:14 +00:00
rstoyanchev e0d6b69195 Update contribution
Closes gh-30300
2024-01-04 14:53:13 +00:00
Yanming Zhou a3532bfccc ResponseStatusException reason as message code for ProblemDetail
See gh-30300
2023-04-06 17:18:27 +08:00
Sébastien Deleuze 318d460256 Add CORS support for Private Network Access
This commit adds CORS support for Private Network Access
by adding an Access-Control-Allow-Private-Network response
header when the preflight request is sent with an
Access-Control-Request-Private-Network header and that
Private Network Access has been enabled in the CORS
configuration.

See https://developer.chrome.com/blog/private-network-access-preflight/
for more details.

Closes gh-28546
2024-01-05 20:07:51 +01:00
Fabrice Bibonne a108e701bc Add Javadoc for use of regexp PathPattern
Closes gh-31886
2024-01-05 14:47:45 +01:00
Brian Clozel 1372265bd9 Undo workaround for SameSite support in WebFlux
This commit implements Cookie support in WebFlux without any workaround
as now all supported servers have the SameSite feature enabled.

Closes gh-31954
2024-01-05 14:44:32 +01:00
Stéphane Nicoll 549f6c1e80 Polish "Fix references to "application/*+xml" in Javadoc"
See gh-31951
2024-01-05 06:44:14 +01:00
pri88yank 16b4c25f7d Fix references to "application/*+xml" in Javadoc
See gh-31951
2024-01-05 06:44:02 +01:00
Stéphane Nicoll 2784f6008e Only log status in ServletRequestHandledEvent
This commit updates the description of RequestHandledEvent to avoid
providing a misleading status as the absence of a failure logs OK which
can be inaccurate.

Closes gh-27595
2024-01-04 11:47:59 +01:00
Sébastien Deleuze 207b9a14f4 Improve the documentation and discoverability of CoWebFilter
Closes gh-31877
2024-01-03 17:50:22 +01:00
Brian Clozel f846d9484c Add Javadoc to MockHttpServletResponse
This commit adds Javadoc to the `getContentLength` method of
`MockHttpServletResponse` to reflect that it gets its value from the
HTTP response header.

Closes gh-31833
2024-01-03 15:19:53 +01:00
Sam Brannen a3c11fc033 Clean up warnings in tests in Gradle build 2024-01-02 16:44:52 +01:00
Stéphane Nicoll e22d1efdc0 Update copyright year of changed files
See gh-31930
2024-01-01 11:00:56 +01:00
Johnny Lim ff8097d37c Polish
See gh-31930
2024-01-01 10:59:35 +01:00
Stéphane Nicoll 3c5d46166e Polish "Replace if with switch where feasible"
See gh-31916
2023-12-28 13:33:32 +01:00
Yanming Zhou cfa3aa001f Replace if with switch where feasible
See gh-31916
2023-12-28 13:29:50 +01:00
Stéphane Nicoll a6e87b40c7 Polish "Use diamond operator where feasible"
See gh-31916
2023-12-28 13:14:26 +01:00
Yanming Zhou 094479b55f Use diamond operator where feasible
See gh-31916
2023-12-28 13:08:08 +01:00
Stéphane Nicoll ed1bfb8177 Polish "Use text block where feasible"
See gh-31916
2023-12-28 13:01:44 +01:00
Yanming Zhou a35384fd57 Use text block where feasible
See gh-31916
2023-12-28 13:01:44 +01:00
Stéphane Nicoll 9d31537ae5 Polish "Use String.repeat() where feasible"
See gh-31916
2023-12-28 13:01:44 +01:00
Yanming Zhou dee1b726f9 Use String.repeat() where feasible
See gh-31916
2023-12-28 13:01:44 +01:00
Yanming Zhou 45080e3724 Remove unnecessary final modifier
final is useless for private and static methods

See gh-31916
2023-12-28 13:01:43 +01:00
Juergen Hoeller a338a16b29 Polishing 2023-12-27 23:23:38 +01:00
Brian Clozel 4afac17e58 Reject invalid forwarded requests in ForwardedHeaderFilter
Prior to this commit, the `ForwardedHeaderFilter` and the forwarded
header utils would throw `IllegalArgumentException` and
`IllegalStateException` when request headers are invalid and cannot be
parsed for Forwarded handling.

This commit aligns the behavior with the WebFlux counterpart by
rejecting such requests with HTTP 400 responses directly.

Fixes gh-31842
2023-12-22 17:27:06 +01:00
Juergen Hoeller 232225b2aa Polishing 2023-12-22 13:06:29 +01:00
Stéphane Nicoll cd8bc2f82a Remove useless empty inheritDoc Javadoc tag 2023-12-22 11:23:11 +01:00
rstoyanchev f0add920f5 Adjust container types to which methodValidation
After the updates to MethodValidationAdapter in commit d7ce13 related
to method validation on element containers, we also need to adjust
the checks in HandlerMethod when method validation applies.

See gh-31746
2023-12-21 17:50:40 +00:00
rstoyanchev 33c149077a Check constraints on container elements
We now check for constraint annotations on elements of a
container to decide whether to apply method validation.

Closes gh-31870
2023-12-21 17:35:19 +00:00
Sam Brannen 3476402a75 Polish switch statements 2023-12-21 17:30:56 +01:00
Juergen Hoeller b04803de99 Polishing 2023-12-21 17:20:29 +01:00
Sébastien Deleuze 85cb6cc5fb Support Kotlin extensions in web handlers
This commit restores support for Kotlin extensions in
web handlers, and adds support for invoking reflectively
suspending extension functions, as well as the other
features supported as of Spring Framework 6.1 like
value classes and default value for parameters.

Closes gh-31876
2023-12-21 12:16:33 +01:00
Brian Clozel 53b937976d Reject setups with multiple observation conventions
Prior to this commit, the `WebHttpHandlerBuilder` would only configure
a custom observation convention if there is a single convention in the
application context. It would other wise use the default.

This commit aligns with the previous Spring Boot behavior where multiple
conventions setups are rejected as invalid with
`NoUniqueBeanDefinitionException`.

Fixes gh-31864
2023-12-19 17:35:02 +01:00
Sébastien Deleuze 12f01f9b5f Add support for @RequestMapping on Kotlin property accessors
This commit refines InvocableHandlerMethod (both Servlet and
Reactive variants) in order to support annotated property
accessors as they translate into regular Java methods, instead
of throwing a NullPointerException.

Closes gh-31856
2023-12-19 12:29:55 +01:00
Sébastien Deleuze 917978cbc2 Refactor InvocableHandlerMethodKotlinTests
The variant in org.springframework.web.method.support in
order to allow testing with a various classes.

See gh-31856
2023-12-19 12:10:13 +01:00
rstoyanchev 3f5c3b1747 Fix checkstyle violation
See gh-31711
2023-12-18 15:32:18 +00:00
rstoyanchev bec7210b4b Improve check to skip bean validation in DataBinder
DataBinder should skip any jakarta.validation.Validator yielding
to method validation when that is expected. This change improves
the check to skip by unwrapping the validator from in a
SmartValidator before checking if it is for bean validation.

Closes gh-31711
2023-12-18 15:25:18 +00:00
rstoyanchev 0a94dce41d Improve HandlerMethod check when method validation applies
Method validation needs to be used for a container such as a List or
Map, but until now we were only checking for a List container.
Moreover, in gh-31530 we improved method validation to also cover
any Collection.

This change aligns with HandlerMethod check for when method validation
applies with the underlying ability of method validation.
2023-12-18 15:25:18 +00:00
Juergen Hoeller 045c5dc1b4 Detect Jetty 12 "max length exceeded" message in handleParseFailure
Closes gh-31850
2023-12-18 16:18:27 +01:00