Commit Graph

1228 Commits

Author SHA1 Message Date
Rossen Stoyanchev 313a7836b0 Provide access to Netty's WebSocketFrame
Closes gh-25099
2020-07-09 15:42:28 +03:00
Rossen Stoyanchev 37366e0c91 Support for custom status in ResponseStatusException
Closes gh-20336
2020-07-09 15:06:33 +03:00
Rossen Stoyanchev 4d7418841c AbstractHandlerMethodMapping refactoring
Remove convenience Map that is to avoid. The only downside is that
getHandlerMethods requires a transformation but that should not be used frequently.

See gh-22961
2020-07-09 12:11:15 +03:00
Rossen Stoyanchev 0584c289ab Support for direct path lookups in WebFlux
Closes gh-22961
2020-07-09 11:26:04 +03:00
Rossen Stoyanchev 0e4e25d227 Updates to CORS patterns contribution
Closes gh-25016
2020-07-08 13:18:46 +03:00
Rossen Stoyanchev 1181bb1852 Rename originsPattern to originPatterns
See gh-25016
2020-07-08 13:18:46 +03:00
Ruslan Akhundov 8632118e8d CorsConfiguration now supports pattern based origins.
Closes gh-24763
2020-07-08 13:18:46 +03:00
Arjen Poutsma 20254f02d2 Polishing 2020-06-30 11:33:12 +02:00
Arjen Poutsma e9d9de5f99 RouterFunction honors PathPatternParser in config
This commit introduces a way to change the PathPatternParser used in
PathPredicates, by way of a ChangePathPatternParserVisitor. This
visitor is used by both WebFluxConfigurationSupport and
WebMvcConfigurationSupport to make sure the configured parser is used.

Closes gh-23236
2020-06-30 11:33:12 +02:00
Rossen Stoyanchev b16f6fa456 Shared static instance of DefaultDataBufferFactory 2020-06-24 16:12:56 +01:00
Arjen Poutsma 973ee9b852 (Re)introduce DefaultMultipartMessageReader
This commit introduces the DefaultMultipartMessageReader, a fully
reactive multipart parser without third party dependencies.

An earlier version of this code was introduced in fb642ce, but removed
again in 77c24aa because of buffering issues.

Closes gh-21659
2020-06-24 10:31:48 +02:00
Rossen Stoyanchev 22bf62def1 Replace remaining use of deprecated Processors in tests
See gh-25085
2020-06-23 20:29:35 +01:00
Rossen Stoyanchev ff9daa9377 Adjust WebFlux behavior for @RequestPart List<T>
List<T> support was added relatively late, incorrectly decoding each
part to T which means no way to decode a single part to List<T> and
thatis the most common case (vs multipart parts with the same name).
This behavior was further misaligned with Spring MVC as well as with
the behavior for T[].

Closes gh-22973
2020-06-22 05:40:13 +01:00
Sam Brannen 9d5881e0ad Suppress warnings, remove unused code, etc. 2020-06-20 17:15:35 +02:00
Sébastien Deleuze 6b355df903 Revert "Upgrade to Kotlin 1.4 M2"
This reverts commit 2a74eff10f.

Some regressions require to wait at least Kotlin 1.4 M3.
2020-06-18 14:06:39 +02:00
Sam Brannen 9984a335ca Merge branch '5.2.x' 2020-06-17 14:01:36 +02:00
Sam Brannen 972c01cbbd Replace "blacklist" with alternative words
See gh-25262
2020-06-17 14:00:26 +02:00
Сергей Цыпанов 7949937655 Remove redundant assignment of default values to volatile fields 2020-06-17 10:50:51 +02:00
Sébastien Deleuze 2a74eff10f Upgrade to Kotlin 1.4 M2
- The compiler is configured to retain compatibility with Kotlin 1.3.
- Explicit API mode is not yet enabled but could be in the future.
- A workaround for Gradle build is required for now, see
  https://youtrack.jetbrains.com/issue/KT-39610 for more details.
- Some exceptions thrown by Kotlin have changed to NullPointerException,
  see https://youtrack.jetbrains.com/issue/KT-22275 for more details.

Closes gh-24171
2020-06-16 15:21:57 +02:00
Rossen Stoyanchev 5225a57411 Support for parsed PathPatterns in Spring MVC
See gh-24945
2020-06-15 11:25:35 +01:00
Juergen Hoeller 9c1c787ee9 Polishing 2020-06-08 19:27:38 +02:00
Juergen Hoeller a34f1e3759 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-test/src/main/java/org/springframework/mock/http/server/reactive/MockServerHttpRequest.java
#	spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/MockServerHttpRequest.java
#	spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClientBuilder.java
2020-06-06 18:52:51 +02:00
Juergen Hoeller 65154170d3 Polishing 2020-06-06 18:49:32 +02:00
Juergen Hoeller d71957ce7c Polishing 2020-06-06 17:45:12 +02:00
Juergen Hoeller 98030f3794 Avoid unnecessary copy of cookies map in DefaultWebClientBuilder
See gh-25034
2020-06-06 17:44:02 +02:00
Juergen Hoeller 65b09be669 Polishing 2020-06-06 16:10:20 +02:00
Juergen Hoeller 5051d7302d Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-test/src/main/java/org/springframework/mock/http/server/reactive/MockServerHttpRequest.java
#	spring-web/src/main/java/org/springframework/http/HttpHeaders.java
#	spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/MockServerHttpRequest.java
2020-06-06 15:27:15 +02:00
Juergen Hoeller d14140da69 Polishing 2020-06-06 13:21:46 +02:00
Rossen Stoyanchev a7f8120164 Merge branch '5.2.x' 2020-06-03 06:14:20 +01:00
Rossen Stoyanchev 8dc8d88f88 Pre-calculated RequestMappingInfo hashcode
See gh-25143
2020-06-03 06:11:35 +01:00
Rossen Stoyanchev 1e25556049 Shared PathPatternParser instance
See gh-25143
2020-06-03 05:58:10 +01:00
Johnny Lim 30351c257c Deprecate methods in ReactorNettyWebSocketClient
Closes gh-25049
2020-05-29 16:24:52 +01:00
Rossen Stoyanchev 6d6269f1ee Switch to Reactor 2020.0.0 snapshots
A switch to RSocket 1.0.1 snapshots is also required to pick up a
for froward compatibility with Reactor Netty 1.0.

See gh-25085
2020-05-29 15:14:01 +01:00
Rossen Stoyanchev d706899b7e Merge branch '5.2.x' 2020-05-28 06:52:23 +01:00
Rossen Stoyanchev a92f425529 Also use constant for custom mapping condition
See gh-25143
2020-05-28 06:51:57 +01:00
Rossen Stoyanchev 90ccabd60b Merge branch '5.2.x' 2020-05-27 19:12:57 +01:00
Rossen Stoyanchev e9a9883aa9 Optimal initialization of empty request mapping conditions
Closes gh-25143
2020-05-27 18:57:02 +01:00
Rossen Stoyanchev b5d9f27ca4 Merge branch '5.2.x' 2020-05-24 21:20:12 +01:00
Rossen Stoyanchev d7a29bbcef DefaultClientResponseBuilder copies logPrefix
Closes gh-25069
2020-05-23 10:41:07 +01:00
Sam Brannen 59443bfe18 Merge branch '5.2.x' 2020-05-20 14:28:56 +02:00
Sam Brannen 4f2b6473ac Honor attributes configured in ServerRequest.from() builder
Prior to this commit, if attributes were configured in the builder
returned by `ServerRequest.from(...)`, those attributes were not
available in the `ServerRequest` built by the builder. In addition, any
attributes in the original `ServerRequest` supplied to
`ServerRequest.from(...)` were also ignored.

This commit addresses this issue by ensuring that the attributes
configured via DefaultServerRequestBuilder are used as the attributes
in the resulting `ServerRequest`.

This commit also polishes the Javadoc in `ServerRequest` and
`ClientResponse` and avoids the use of lambda expressions in the
constructors for `DefaultServerRequestBuilder` and
`DefaultClientResponseBuilder`.

Closes gh-25106
2020-05-20 14:10:44 +02:00
Rossen Stoyanchev de378599d3 Provide access to CloseStatus in WebSocketSession
Closes gh-22079
2020-05-14 15:42:43 +01:00
Brian Clozel b883aad1f1 Use weak ETags in VersionResourceResolver
Prior to this commit, the `VersionResourceResolver` implementations
would write a strong ETag HTTP response header with the resolved version
of the resource (the actual value depending on the chosen strategy).

This approach doesn't work well when combined with HTTP compression.
Web servers disable HTTP response copression in the presence of strong
ETags since mutating the response body would break the contract.

This commit changes this semantic and ensures that weak ETags are used
instead.

Closes gh-24898
2020-05-11 21:25:54 +02:00
Rossen Stoyanchev 94824e30a4 Avoid parse cookies when mutating request or response
When mutating a ServerHttpRequest or ClientResponse, the respective
builders no longer access cookies automatically which causes them to
be parsed and does so only if necessary. Likewise re-applying the
read-only HttpHeaders wrapper is avoided.

See gh-24680
2020-05-11 08:49:28 +01:00
Rossen Stoyanchev 0e9ecb6c99 Shortcut handling of bodyToFlux(DataBuffer.class)
Given that the body is a Flux<DataBuffer> there probably could be a
Flux<DataBuffer> body();

At least bodyToFlux(DataBuffer.class) which is used when mutating and
is a common case should not incur overhead.

See gh-24680
2020-05-11 08:49:28 +01:00
Rossen Stoyanchev 67a06f5edc Add mutate() to ClientResponse and deprecate from()
from() has the flaw of ignoring the body and it can't be fixed because
applications are guaranteed to be setting it already and if set twice
the builder drains the first body.

mutate() is a better fit in any case for what needs to be done in a
filter chain. It can be done more efficiently and is consistent with
similar options on the server side.

See gh-24680
2020-05-11 08:49:28 +01:00
Rossen Stoyanchev df99889aa6 Avoided repeated creation of ReadOnlyHttpHeaders wrapper
See gh-24680
2020-05-11 08:49:28 +01:00
Rossen Stoyanchev 3276f81851 Avoid one layer of HttpHeaders wrapping
See gh-24680
2020-05-11 08:49:28 +01:00
Rossen Stoyanchev 7f59381c7d Add support for RxJava 3
Closes gh-24170
2020-05-11 08:48:48 +01:00
Rossen Stoyanchev 1da903dd59 Add PartHttpMessageWriter
Closes gh-24535
2020-05-08 07:54:50 +01:00