Commit Graph

21636 Commits

Author SHA1 Message Date
Juergen Hoeller
d55c5b30d7 Merge branch '5.2.x' 2020-10-07 15:34:57 +02:00
Juergen Hoeller
ec9de943ee Construct StringBuilder in StreamUtils with appropriate initial size
Closes gh-25789
2020-10-07 15:11:53 +02:00
Rossen Stoyanchev
1c1bc41e24 Merge branch '5.2.x' into master 2020-10-07 12:45:51 +01:00
Rossen Stoyanchev
eb11c6fa23 Reinstate removal of jsessionid from lookup path
Closes gh-25864
2020-10-07 11:31:52 +01:00
Sébastien Deleuze
7d7ed88739 Provide WebClient#exchange() alternative for Coroutines
This commit adds awaitExchange { } and
exchangeToFlow { } extensions as Coroutines variants for
exchangeToMono() and exchangeToFlux().

Closes gh-25751
2020-10-07 11:09:12 +02:00
Sébastien Deleuze
e899397438 Add missing ClientResponse Coroutines extensions
This commit adds awaitBodilessEntity() and
createExceptionAndAwait() missing ClientResponse
Coroutines extensions.

Closes gh-25866
2020-10-07 11:06:43 +02:00
Arjen Poutsma
b2d8180f82 Add params and remoteAddress to request builder
This commit adds methods for adding/changing parameters and remote
address in the WebMvc.fn request builder.

Closes gh-25776
2020-10-07 10:30:02 +02:00
Sébastien Deleuze
9990bd2ea8 Fix checkstyle errors
See gh-25771
2020-10-06 23:13:38 +02:00
Sébastien Deleuze
92b2c45281 Add kotlinx.serialization JSON support to Spring WebFlux
Flow decoding is not supported yet since it depends on
kotlin/kotlinx.serialization#1073, but it will be
enabled when this issue will be fixed.

Closes gh-25771
2020-10-06 23:02:33 +02:00
Rossen Stoyanchev
1cd8871d7f FormHttpMessageConverter preserves MediaType parameters
Closes gh-25839
2020-10-06 18:28:39 +01:00
Rossen Stoyanchev
1c5b95db0b Revert workaround in Jetty connector
The workaround was removed in the 5.3 milestone phase and in master
only because the referenced Jetty issue is marked fixed. However,
what we need to replace it with should be a little more involved
and also it's not entirely clear if the fixes in Jetty aligns with
our release and retain semantics so that needs to be investigated
more thoroughly.
2020-10-06 18:18:26 +01:00
Rossen Stoyanchev
30c7940483 Fix recent regression in WebTestClient
Closes gh-25854
2020-10-06 17:04:48 +01:00
Juergen Hoeller
e78aa6b8f8 Upgrade to Groovy 3.0.6 2020-10-06 16:55:58 +02:00
Juergen Hoeller
f5d9babfd2 Avoid reflection when creating instances of well-known View classes
Closes gh-25847
2020-10-06 16:55:42 +02:00
Brian Clozel
a0af552d0f Add option for ignoring last-modified for static resources
Prior to this commit, the resource handler serving static resources for
Spring MVC and Spring WebFlux would always look at the
`Resource#lastModified` information, derive the `"Last-Modified"` HTTP
response header and support HTTP conditional requests with that
information.

In some cases, builds or packaging tools choose to set this last
modification date to a static date in the past. This allows tools to
have reproducible builds or to leverage caching given the static
resources content didn't change.

This can lead to problems where this static date (e.g. "1980-01-01") is
used literally in HTTP responses and will make the HTTP caching
mechanism counter-productive: the content of the resources changed, but
the application insists on saying it didn't change since the 80s...

This commit adds a new configuration option to disable this support -
there is no way to automatically discard those dates: there is no
standard for that and many don't use he "EPOCH 0 date" as it can lead to
compatibility issues with different OSes.

Closes gh-25845
2020-10-06 16:30:35 +02:00
Philippe Marschall
cf61545f41 Add Dependencies Manifest Entry to spring-core
Add a Dependencies manifest entry with the value jdk.unsupported to
spring-core.
2020-10-06 15:45:49 +02:00
Сергей Цыпанов
8a04910bdd Drop explicit zeroing at instantiation of Atomic* objects 2020-10-06 15:45:12 +02:00
Juergen Hoeller
b7e1553c9d Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-orm/src/main/java/org/springframework/orm/hibernate5/LocalSessionFactoryBuilder.java
2020-10-06 15:37:54 +02:00
Arjen Poutsma
392895e256 Revert errorhandler order in RouterFunctionBuilder
Prior to this commit, error handlers in the WebMvc.fn and WebFlux.fn
router function builders had to be registered in an unintuitive, reverse
order, due to the filter chain composition model used.
This commit reverses the error handler order, so that more specific
error handlers can come before generic ones.

Closes gh-25541
2020-10-06 15:32:22 +02:00
Juergen Hoeller
ca7fb23432 Upgrade to Hibernate ORM 5.4.22, Hibernate Validator 6.1.6, Undertow 2.0.32, Checkstyle 8.36.2 2020-10-06 15:31:46 +02:00
Juergen Hoeller
f83bb7183e Polishing 2020-10-06 15:31:34 +02:00
Juergen Hoeller
1745a3f25d Consistent @Nullable declarations on overridden converter methods 2020-10-06 15:31:26 +02:00
Juergen Hoeller
e417318915 Revise native Hibernate 5 bootstrapping with JTA transaction manager
Closes gh-25858
2020-10-06 15:31:19 +02:00
Arjen Poutsma
200b33b26a Add no path HTTP method variants for route builder
This commit adds two overloaded methods for each HTTP method in the
WebFlux.fn and WebMvc.fn route builders: one method taking just a
handler function, the other a request predicate and handler function.

After this commit, it is no longer required to provide a String path,
which is particularly useful when nesting routes, and the path would be
"".

Closes gh-25752
2020-10-06 11:00:17 +02:00
Rossen Stoyanchev
d3087537d5 Merge branch '5.2.x' into master 2020-10-02 14:39:27 +01:00
Arjen Poutsma
444c8185b6 Add document on async support in WebMvc.fn
This commit adds reference documentation about the support for
asynchronous types in WebMvc.fn.
2020-10-02 15:04:25 +02:00
Rossen Stoyanchev
2533ba5253 Use Mono.fromDirect for Jetty ReactiveRespnose
Closes gh-25849
2020-10-02 13:43:42 +01:00
Rossen Stoyanchev
e44b08f1fc Minor refactoring in JettyClientHttpConnector
See gh-25849
2020-10-02 13:32:00 +01:00
Arjen Poutsma
3303a68436 Use registry to convert to CompletableFuture
Use the ReactiveAdapterRegistry to convert to CompletableFuture,
and remove the ToFutureSubscriber.
2020-10-02 11:39:31 +02:00
Arjen Poutsma
4e76a4780c Add ServerResponse.async() in WebMvc.fn
This commit introduces a new async(Object) method in the WebMvc.fn,
taking a asynchronous response as argument in the form of a
CompletableFuture or Publisher. This allows for asynchronous setting
of headers and status (and not just body, which was already possible).

Closes gh-25828
2020-10-02 10:36:16 +02:00
Sam Brannen
c083b95ce1 Polishing 2020-10-01 15:42:06 +02:00
Sam Brannen
92cc006b2c Delete unused code 2020-10-01 15:14:55 +02:00
Rossen Stoyanchev
dfb7ca733a Merge branch '5.2.x' into master 2020-09-30 22:10:42 +01:00
Rossen Stoyanchev
86f2ebec1b Fix recursion issue caused by previous commit
See gh-25821
2020-09-30 22:03:46 +01:00
Rossen Stoyanchev
7ad60d385b Fix issue with copying headers in NativeMessageHeaderAccessor
Closes gh-25821
2020-09-30 21:42:26 +01:00
Rossen Stoyanchev
4b9c3fa739 Polishing Javadoc
See gh-25821
2020-09-30 21:42:26 +01:00
Sam Brannen
a6bede22c1 Polish contribution
See gh-23379
2020-09-29 14:25:04 +02:00
Josh Cummings
a0c00362c3 Introduce Converter.andThen(...)
Closes gh-23379
2020-09-29 14:04:57 +02:00
Arjen Poutsma
8057fb38b2 DefaultPartHttpMessageReader reference docs
This commit changes the WebFlux reference documentation from the
SynchronossPartHttpMessageReader to the DefaultPartHttpMessageReader.

Closes gh-25827
2020-09-28 10:19:49 +02:00
Sam Brannen
ba94a1216c Deprecate HttpStatus.Series.valueOf(HttpStatus) and polish
See gh-22366
2020-09-26 16:06:31 +02:00
Nico Heller
97cc89630d Remove inefficiency in HttpStatus.series()
Prior to this commit, the Series value for an HttpStatus was always
evaluated which resulted in an allocation of a Series array by invoking
Series.values() which makes a defensive copy.

This commit addresses this issue by hardcoding the corresponding Series
within the HttpStatus constructor, thereby avoiding any unnecessary
computations. In addition, a unit test has been added to verify that
all HttpStatus enum constants have a properly configured Series.

Closes gh-22366
2020-09-26 15:04:15 +02:00
Sam Brannen
b34778d220 Polishing 2020-09-26 15:02:15 +02:00
Rossen Stoyanchev
c45be0bf27 Polishing contribution
Closes gh-25780
2020-09-25 21:53:20 +01:00
Anthony Raymond
10eb5bde59 Do not resolve Principal argument if annotated
Closes gh-25780
2020-09-25 21:47:35 +01:00
Rossen Stoyanchev
52084ed954 Update WebFlux docs on logging with async appenders
Closes gh-25547
2020-09-25 21:44:35 +01:00
Rossen Stoyanchev
b9ef5416b9 Expose combine method in CorsConfiguration
Closes gh-25716
2020-09-25 21:36:18 +01:00
Rossen Stoyanchev
852e904b08 Exposes getter for part converters in FormHttpMessageConverter
Closes gh-25817
2020-09-25 21:31:44 +01:00
Rossen Stoyanchev
bedf2de614 Merge branch '25751-exchange-deprecation' into master
Closes gh-25751
2020-09-25 21:17:25 +01:00
Rossen Stoyanchev
10c5f85a9f WebTestClient documentation updates
See gh-25751
2020-09-25 21:17:07 +01:00
Rossen Stoyanchev
db9190e0e6 Remove use of WebClient#exchange from WebTestClient
The exchange() method is now deprecated because it is not safe for
general use but that doesn't apply to the WebTestClient because it
exposes a different higher level API for response handling that
ensures the response is consumed. Nevertheless WebTestClient cannot
call WebClient.exchange() any more.

To fix this WebTestClient no longer delegates to WebClient and thus
gains direct access to the underlying ExchangeFunction. This is
not a big deal because WebClient and WebTestClient do the same
only when it comes to gathering builder options and request input.

See gh-25751
2020-09-25 21:16:44 +01:00