Commit Graph

1930 Commits

Author SHA1 Message Date
Sébastien Deleuze
abe381488a Add missing RequestPredicate variants in coRouter
Closes gh-32256
2024-02-13 14:50:49 +01:00
Sébastien Deleuze
2fe3321813 Fix pathExtension null-safety in Kotlin DSLs
Closes gh-32254
2024-02-13 14:24:19 +01:00
Sébastien Deleuze
2d7b2e59b6 Add resource redirection to WebFlux functional router
See gh-27257
2024-02-13 13:24:13 +01:00
Arjen Poutsma
750cb73902 Introduce single-value request predicates
This commit introduces new HTTP method, Content-Type, and Accept header
request predicates that handle single values. Previously, these
predicates were always dealt with as single-value collections, which
introduced computational overhead.

Closes gh-32244
2024-02-12 16:09:00 +01:00
Sébastien Deleuze
99bdc4211d Add Coroutines support to NonReactiveHandlerMethodPredicate
Closes gh-32227
2024-02-09 12:07:17 +01:00
Arjen Poutsma
af44b3e6c0 Fix delegation in ServerRequest decorators
Closes gh-31955
2024-02-08 11:33:22 +01:00
Patrick Strawderman
d5cb1d9adb Initialize Map with correct size in RequestPredicates
Prior to this commit, the `RequestPredicates` would add new attributes
to the existing request attributes by creating a new `LinkedHashMap`
with the total number of elements as its new initial capacity.

This would not achieve optimal performance as initial resize or rehash
operations could be expected. Consistently using
`CollectionUtils#newLinkedHashMap` avoids this problem.

Closes gh-32201
2024-02-06 10:54:00 +01:00
Sam Brannen
067638ae6e Introduce ClassUtils.isVoidType() utility method 2024-01-30 16:27:34 +01:00
Sam Brannen
398cc01650 Polishing 2024-01-30 16:24:55 +01:00
Sam Brannen
db535863dd Consistently use class literals for primitive types
To improve consistency and avoid confusion regarding primitive types
and their wrapper types, this commit ensures that we always use class
literals for primitive types.

For example, instead of using the `Void.TYPE` constant, we now
consistently use `void.class`.
2024-01-30 15:26:12 +01:00
Sam Brannen
9eae0ba50e Clean up warnings in build 2024-01-29 17:47:46 +01:00
Kai Zander
d96a63944c Simplify use of Reactor's cast operator
This commit replaces filter(x -> x instanceof C).cast(C.class) with the
built-in ofType(C.class).

See gh-32141
2024-01-27 12:21:46 +01:00
Arjen Poutsma
f2e267b494 Guard against multiple body subscriptions
Before this commit, the JDK and Jetty connectors do not have any
safeguards against multiple body subscriptions. Such as check has now
been added.

Closes gh-32100
2024-01-24 14:05:20 +01:00
Juergen Hoeller
199a675692 Declare current observation context as available since 6.0.15
See gh-31609
See gh-31646
2024-01-24 12:40:00 +01:00
Juergen Hoeller
2f921dd13d Declare allowPrivateNetwork as available since 5.3.32
See gh-28546
See gh-31974
2024-01-24 12:37:19 +01:00
Sam Brannen
45a1f98bd6 Polishing 2024-01-23 11:36:24 +01:00
Juergen Hoeller
5faace0eb3 Predetermine validation groups on initialization
Closes gh-32068
2024-01-23 11:15:12 +01:00
Sam Brannen
3b2f6e74a6 Make assertions based on Annotation#toString() lenient
The behavior for the toString() implementation for annotations changed
in JDK 19, per my request to the JDK team (see link below).

Specifically, since JDK 19, the toString() implementation for annotation
proxies created by the JDK started using canonical names instead of
binary names for types.

See https://bugs.openjdk.org/browse/JDK-8281462
2024-01-23 10:41:40 +01:00
Sam Brannen
1a52c56bd4 Polishing 2024-01-19 19:16:41 +01:00
Sam Brannen
4cc91a2869 Ensure inherited @⁠HttpExchange annotation can be overridden in controller
This commit revises the RequestMappingHandlerMapping implementations in
Spring MVC and Spring WebFlux to ensure that a @⁠Controller class which
implements an interface annotated with @⁠HttpExchange annotations can
inherit the @⁠HttpExchange declarations from the interface or
optionally override them locally with @⁠HttpExchange or
@⁠RequestMapping annotations.

Closes gh-32065
2024-01-19 18:54:31 +01:00
Sam Brannen
6697461003 Reject mixed @⁠RequestMapping and @⁠HttpExchange declarations in MVC & WebFlux
This commit updates the RequestMappingHandlerMapping implementations in
Spring MVC and Spring WebFlux so that mixed @⁠RequestMapping and
@⁠HttpExchange declarations on the same element are rejected.

Note, however, that a @⁠Controller class which implements an interface
annotated with @⁠HttpExchange annotations can still inherit the
@⁠HttpExchange declarations from the interface or optionally override
them locally with @⁠HttpExchange or @⁠RequestMapping annotations.

See gh-31962
See gh-32049
Closes gh-32065
2024-01-19 16:23:42 +01:00
Sam Brannen
2ec0c16889 Polishing 2024-01-18 17:30:07 +01:00
Sam Brannen
d1d9d483fe Document @⁠HttpExchange support in RequestMappingHandlerMapping 2024-01-18 16:28:40 +01:00
Sam Brannen
b8b31ff8a1 Reject multiple @⁠HttpExchange declarations in MVC and WebFlux
This commit updates the RequestMappingHandlerMapping implementations in
Spring MVC and Spring WebFlux so that multiple @⁠HttpExchange
declarations on the same element are rejected.

Closes gh-32049
2024-01-18 15:29:30 +01:00
Sam Brannen
c5c77b93fe Polishing 2024-01-18 15:29:30 +01:00
Sam Brannen
6b905049eb Polishing
See gh-31962
2024-01-18 14:21:45 +01:00
Stéphane Nicoll
f5b0d9509d Polish 2024-01-17 18:41:15 +01:00
Sam Brannen
699da7c383 Log warning if multiple @⁠RequestMapping annotations are declared
If multiple request mapping annotations are discovered, Spring MVC and
Spring WebFlux now log a warning similar to the following (without
newlines).

Multiple @⁠RequestMapping annotations found on
void org.example.MyController.put(), but only the first will be used:
[
@⁠org.springframework.web.bind.annotation.PutMapping(consumes={}, headers={}, name="", params={}, path={"/put"}, produces={}, value={"/put"}),
@⁠org.springframework.web.bind.annotation.PostMapping(consumes={}, headers={}, name="", params={}, path={"/put"}, produces={}, value={"/put"})
]

Closes gh-31962
2024-01-17 17:46:31 +01:00
Sébastien Deleuze
5dd48fc068 Mention PathPattern in functional router Javadoc
This commit makes the various supported patterns
more discoverable.

Closes gh-32045
2024-01-17 15:08:34 +01:00
rstoyanchev
682f4715cf Polishing
See gh-30393
2024-01-17 10:15:09 +00:00
rstoyanchev
c4a34fa26c Improve cancel handling in AbstractListenerReadPublisher
Closes gh-30393
2024-01-17 10:15:09 +00:00
Stéphane Nicoll
0c42965fc3 Polish 2024-01-15 11:17:19 +01:00
Stéphane Nicoll
f1a335708a Polish 2024-01-11 14:05:37 +01:00
rstoyanchev
2b4ffe0391 Consistent inclusion of baseUrl in URI_TEMPLATE attribute
Closes gh-31882
2024-01-10 20:39:14 +00:00
rstoyanchev
e7eaaaded1 Explicit initialization of shouldValidate flags
Closes gh-32007
2024-01-10 18:13:25 +00:00
rstoyanchev
168c60c18a Polishing contribution
Closes gh-31992
2024-01-10 12:17:20 +00:00
Aaron Rosser
1e49334209 Exclude query from URI in WebClient checkpoints
See gh-31992
2024-01-10 12:17:20 +00:00
Stéphane Nicoll
1f2d29ee08 Polish 2024-01-08 17:12:33 +01: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
Sam Brannen
a3c11fc033 Clean up warnings in tests in Gradle build 2024-01-02 16:44:52 +01:00
Juergen Hoeller
f5b4f7d9e8 Support for SSLContext configuration on StandardWebSocketClient
Closes gh-30680
2023-12-28 23:42:04 +01:00
Stéphane Nicoll
eefe65d95a Upgrade copyright year of changed files
See gh-31916
2023-12-28 13:36:58 +01:00
Stéphane Nicoll
adcf236a3d Polish "Use Object.equals() where feasible"
See gh-31916
2023-12-28 13:21:46 +01:00
Yanming Zhou
72a9864788 Use Object.equals() where feasible
See gh-31916
2023-12-28 13:19:03 +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
Yanming Zhou
db2c532c07 Use auto boxing and unboxing where feasible
See gh-31916
2023-12-28 13:01:44 +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
7e5afc8bbb Update copyright year of changed files
See gh-31913
2023-12-28 11:47:17 +01:00