Commit Graph

800 Commits

Author SHA1 Message Date
Juergen Hoeller de38af6843 Upgrade to JUnit Jupiter 5.3 RC1 (and Jetty 9.4.12 RC1)
Includes Groovy 2.5.2, Undertow 2.0.12, Hibernate Validator 6.0.12.

Issue: SPR-17129
2018-08-14 20:33:30 +02:00
Sam Brannen 8126ffbc8c Fix broken links in JavaDoc
Issue: SPR-17174
2018-08-13 12:22:52 +02:00
Sam Brannen cfb1ed1009 Clean up warnings and delete dead code 2018-08-12 15:55:11 +02:00
Rossen Stoyanchev aef39e8954 Remove test class added by mistake 2018-08-10 16:57:46 +03:00
Rossen Stoyanchev 61c52d64c5 Polish ConcurrentWebSocketSessionDecoratorTests 2018-08-10 16:15:21 +03:00
Sebastien Deleuze 6b6384a09e Improve WebFlux Protobuf support
- Update javadoc for decoding default instances
 - Refactor and simplify tests
 - Add missing tests
 - Refactor decoding with flatMapIterable instead of
   concatMap and avoid recursive call

Issue: SPR-15776
2018-08-09 15:47:45 +02:00
Juergen Hoeller 58e9706991 Polishing 2018-08-09 02:26:36 +02:00
Juergen Hoeller 247ec572b2 Consistent hasAnnotation check for findMergedAnnotation lookup
Issue: SPR-16933
2018-08-08 23:54:56 +02:00
Rossen Stoyanchev a0dfdfcac3 Hierarchy under WebClientResponseException
Issue: SPR-17145
2018-08-08 15:34:08 +03:00
Sebastien Deleuze 7e9b7102b7 Support custom CorsConfigurationSource in AbstractHandlerMapping
This commit allows to specify a custom CorsConfigurationSource
in AbstractHandlerMapping (both Servlet and Reactive variants).

AbstractHandlerMapping#getCorsConfigurations method is now
deprecated.

Issue: SPR-17067
2018-08-08 10:08:55 +02:00
Juergen Hoeller 34ddb88851 ConcurrentModel.addAttribute(String, Object) ignores null value
Issue: SPR-17141
2018-08-07 20:35:34 +02:00
Rossen Stoyanchev 4a18488f30 Update deprecated basic auth client filters.
1. Update ExchangeFilterFunctions to delegate internally to
HttpHeaders.setBasicAuth(user, password).

2. Remove deprecation from
ExchangeFilterFunctions.basicAuthentication(String user, String password)
It is still useful as a filter to insert the header.

3. Update deprecation notes.

Issue: SPR-17099
2018-08-07 10:10:27 +03:00
Juergen Hoeller 943b394992 Polishing 2018-08-06 18:34:00 +02:00
Sebastien Deleuze 2054fa2191 Upgrade to Jetty reactive HTTP client 1.0.1
Issue: SPR-17124
2018-08-06 12:01:29 +02:00
Juergen Hoeller 821ab62492 Upgrade to RxJava 2.2 and Kotlin 1.2.60
Includes latest dependency updates (Mockito 2.21, Log4J 2.11.1, Hibernate ORM 5.3.4, Protobuf 3.6.1, JRuby 9.2, HtmlUnit 2.32, Selenium 3.14) for Spring Framework 5.1.

Issue: SPR-16388
Issue: SPR-16239
2018-08-03 23:18:10 +02:00
Rossen Stoyanchev a8a1fc6de5 Earlier processing of forwarded headers
Forwarded headers are now processed before ServerWebExchange is created
through ForwardedHeaderTransformer which has the same logic as the
ForwardedHeaderFilter but works on the request only.

ForwardedHeaderFilter is deprecated as of 5.1 but if registered it is
removed from the list of filters and ForwardedHeaderTransformer is used
instead.

Issue: SPR-17072
2018-08-03 15:16:09 +03:00
Rossen Stoyanchev aec98268fe maxResponseBody client filter
Issue: SPR-16989
2018-08-02 21:19:22 +03:00
Juergen Hoeller 217aa38cbb Polishing 2018-08-02 18:00:42 +02:00
Juergen Hoeller 2474c48749 Polishing 2018-08-02 16:55:53 +02:00
stsypanov b5c691bdac SPR-17074 Replace pointless wrapping with Arrays.asList with iteration over array 2018-08-02 12:07:00 +02:00
Juergen Hoeller 589b7048ec Avoid synthesizable annotation creation for @Bean/@Scope processing
Includes consistent (non-)use of AnnotationUtils/AnnotatedElementUtils.

Issue: SPR-16933
2018-08-01 11:43:28 +02:00
Сергей Цыпанов f8340838b3 Use lambda expressions for lazy instantiation (#1911)
Issue: SPR-17074
2018-07-31 13:03:18 +02:00
Juergen Hoeller 4a147d26fc Initialize pre-filled HashMaps with large enough capacity
Empty Maps are preferably initialized without capacity (not initializing them at all or lazily initializing with default capacity when needed).

Issue: SPR-17105
2018-07-30 22:07:31 +02:00
Rossen Stoyanchev 91d17cf628 Add notes on future deprecation of the RestTemplate
Issue: SPR-16993
2018-07-27 08:41:20 -04:00
Rossen Stoyanchev f5ff1dc3f9 Comment on difference in matrix variable test
Based on discussion under
https://github.com/spring-projects/spring-framework/pull/1901
2018-07-27 08:40:36 -04:00
Juergen Hoeller 2b2bf27933 Polishing 2018-07-25 15:26:52 +02:00
Juergen Hoeller 3881a4aded Polishing 2018-07-25 14:16:02 +02:00
Juergen Hoeller fd8e4abe5d Introduce ResolvableType.toClass() shortcut
Issue: SPR-17086
2018-07-25 14:15:19 +02:00
Sebastien Deleuze d3b244a81b Optimize class detection by sharing the ClassLoader
Issue: SPR-17083
2018-07-25 11:09:42 +02:00
Rossen Stoyanchev 32faf09a80 Add check for mixing @EnableWebMvc and @EnableWebFlux
Issue: SPR-16609
2018-07-24 20:47:26 -04:00
Rossen Stoyanchev 0be8c20fca Consistent logging of selected media types 2018-07-24 20:47:26 -04:00
sdeleuze 36a07aa897 Support Protobuf serialization in WebFlux
This commit introduces Protobuf support in WebFlux via dedicated
codecs.

Flux<Message> are serialized/deserialized using delimited Protobuf
messages with the size of each message specified before the message
itself. In that case, a "delimited=true" parameter is added to the
content type.

Mono<Message> are expected to use regular Protobuf message
format (without the size prepended before the message).

Related HttpMessageReader/Writer are automatically registered when the
"com.google.protobuf:protobuf-java" library is detected in the classpath,
and can be customized easily if needed via CodecConfigurer, for example
to specify protocol extensions via the ExtensionRegistry based
constructors.

Both "application/x-protobuf" and "application/octet-stream" mime types
are supported.

Issue: SPR-15776
2018-07-25 01:17:06 +02:00
Brian Clozel 195f3f07e7 ResponseEntityResultHandler overwrites headers
Prior to this commit, controller handlers (regular and exception
handlers as well) would not overwrite existing HTTP response headers on
the exchange. This would lead to situations where Content-Type values
set during the initial handling phase would not be overwritten when
handling an error later on.

This commit aligns the implementation of that result handler on the
Spring MVC one in that regard.

Issue: SPR-17082
2018-07-24 22:21:30 +02:00
Juergen Hoeller 11881ff211 Polishing 2018-07-24 18:45:52 +02:00
Juergen Hoeller dd4468a74a Polishing 2018-07-24 16:16:52 +02:00
Juergen Hoeller 3c65c17053 Correctly determine and propagate validation hints to DataBinder
Issue: SPR-17073
2018-07-21 12:19:37 +02:00
Juergen Hoeller 9a43d2ec20 Revised log levels: less WARN and INFO, fine-tuned DEBUG vs TRACE
Issue: SPR-16946
2018-07-20 15:05:16 +02:00
Brian Clozel a410d90439 Drain client response body consistenly
Prior to this commit, the `DefaultClientResponse` implementation would
handle HTTP client cases where the server response body would need to be
consumed (pooled resources need to be released) and the body publisher
cancelled right away. This is done to avoid reading the whole response
body and returning the connection to the pool, now that this connection
cannot be reused.

This was done already when the `WebClient` is asked for a `Void` type
for the response body.

SPR-17054 brought a new case for that: whenever no message reader is
able to decode the response body, an `UnsupportedMediaTypeException`
error signal is sent. Prior to this commit, the response body would not
be consumed and cancelled for that case.

This commit refactors all those cases from the `DefaultClientResponse`
directly into the `BodyExtractors`, since most of the logic and
knowledge for that belongs there. We only need to only apply this
behavior when the HTTP client is involved, as the server does not want
this to happen.

Issue: SPR-17054
2018-07-20 14:01:34 +02:00
Juergen Hoeller 867b3d233d Upgrade to OkHttp 3.11, Apache HttpClient 4.5.6, Hibernate Validator 6.0.11 2018-07-19 17:52:08 +02:00
Rossen Stoyanchev 66d73017d5 PathVariable consistently reflects value up to 1st ";"
Given "/{foo}" and "/a=42;c=b", previously that would be treated as a
sequence of matrix vars with an empty path variable. After the change
the path variable "foo" is "a=42".

This should be ok for backawards compatibility since it's unlikely for
anything to rely on an empty path variable.

Issue: SPR-11897
2018-07-18 22:14:02 -04:00
sdeleuze a87764f1fd Add support for Jetty Reactive Streams HTTP client
Leverage https://github.com/jetty-project/jetty-reactive-httpclient
to add support for Jetty in WebClient via JettyClientHttpConnector.

Implemented with buffer copy instead of optimized buffer wrapping
because the latter hangs since Callback#succeeded doesn't allow
releasing the buffer and requesting more data at different times
(required for Mono<DataBuffer> for example).
See https://github.com/eclipse/jetty.project/issues/2429.

Issue: SPR-15092
2018-07-18 14:49:49 +02:00
Sebastien Deleuze 3c9049d530 Leverage Jetty BOM
Issue: SPR-17058
2018-07-18 14:49:49 +02:00
Brian Clozel a7f97a1669 Avoid null signals when resolving handler arguments
Prior to this commit, resolving an argument for a WebFlux controller
that's missing from the request and not required by the handler would
throw a NullPointerException in some cases.

This involves the conversion of the parameter (a `String` parameter type
might not trigger this behavior) and sending a `null` within a reactive
stream, which is illegal per the RS spec.

We now rely on a `Mono.justOrEmpty()` to handle those specific cases.

Issue: SPR-17050
2018-07-18 14:41:43 +02:00
Brian Clozel 75fa9c4266 Fix checkstyle issues 2018-07-12 21:54:32 +02:00
Brian Clozel 038af9a303 Improve unknown status codes handling by WebClient
Prior to this commit, `WebClient` would throw `IllegalArgumentException`
when receiving an HTTP response with an unknown HTTP status code.

This commit is a follow up of SPR-16748 (supporting non-standard HTTP
status codes on the reactive `ClientHttpResponse`), and is mirroring
SPR-15978 (supporting non-standard HTTP status codes in `RestTemplate`).

With this change, `WebClient` now tolerates unknown status codes in some
cases, while not offering that choice as a first class citizen:
`HttpStatus` is still the preferred way to deal with HTTP status codes.

Here's how `WebClient` will behave when fetching the full response:

```
// Given a remote endpoint returning a "123" HTTP status code
Mono<ClientResponse> result = this.webClient.get()
				.uri("/status/123")
				.exchange();

// will still throw an IllegalArgumentException
HttpStatus status = result.block().statusCode();

// is safe and will return 123
int statusCode = result.block().rawStatusCode();
```

Resolving directly the response body with `retrieve()` is different.

```
// will send an error signal with a UnknownHttpStatusCodeException
Mono<String> result = this.webClient.get()
				.uri("/status/123")
				.retrieve()
				.bodyToMono(String.class);
```

In general, `WebClient` will provide high-level support
for well-known HTTP status codes, like error handling with
`WebClient.ResponseSpec#onStatus`.

For such support with unknown status codes, it is better to rely
on lower level constructs such as `ExchangeFilterFunction`.

Issue: SPR-16819
2018-07-12 19:08:08 +02:00
Rossen Stoyanchev 1b1bc7f5b5 Switch defaults and model for logging sensitive data
Issue: SPR-17029
2018-07-11 11:10:03 -04:00
xiexed d5df097e0e Small typo fixes in WebSocketHandler doc 2018-07-09 14:27:23 -04:00
Arjen Poutsma a663454fad Changed Basic Authentication consumer to setBasicAuth method
This commit changes the Basic Authentication Consumer<HttpHeaders> to
a basic setBasicAuth(String, String) method.

Issue: SPR-16913
2018-07-09 16:41:51 +02:00
Rossen Stoyanchev 2874dd75ca Fine-tune WebFlux logging at HTTP/WebSocket level
1. Use special category prefix "spring-web.reactivestreams" for logging
of reactive streams signals in spring-web, since those are quite
verbose would fill the logs at TRACE.

2. Add and use loggers in request and websocket session implementations
separate from reactive streams bridge for regular TRACE logging.

3. Improve log messages and add where missing (e.g. for Reactor)

Issue: SPR-16898
2018-07-06 17:33:16 -04:00
Rossen Stoyanchev bc3cf0eeb8 Expose request id at the ServerHttpRequest level
Hiding it (at AbstractServerHttpRequest) complicates matters since
requests are often mutated and decorated, plus it's also possible to
implement the interface directly (we've one, albeit corner case).

Issue: SPR-16966
2018-07-06 15:44:24 -04:00
Rossen Stoyanchev 5dc49b16ea Correlated messages at HTTP adapter + WebSocket level
Issue: SPR-16966
2018-07-06 15:44:18 -04:00
Rossen Stoyanchev 7be2943c03 Simplify WebSocket client implementationss in WebFlux
1. Eliminate WebSocketClientSupport base class whose main value was
to provide logging but those methods get in the way of inserting a
log prefix.

2. Remove checks and synchronization in lifecycle methods of Jetty
client since underlying Jetty client already has that.
2018-07-06 15:17:11 -04:00
Sebastien Deleuze fd69c90fcb Add ServerResponse extensions for json, xml and html
Issue: SPR-17017
2018-07-06 14:52:11 +02:00
Juergen Hoeller 2cd006923c Polishing 2018-07-06 14:38:29 +02:00
Sebastien Deleuze c0264072ab Avoid ServerResponse static imports in WebFlux router DSL
Provide functions like ok() in RouterFunctionDsl to avoid
ServerResponse static imports.

Issue: SPR-17009
2018-07-06 13:50:27 +02:00
Arjen Poutsma 37a3765a4e Fix checkstyle errors 2018-07-06 13:38:17 +02:00
Arjen Poutsma 490302ebf8 Added RequestPredicates.methods(HttpMethod...)
Added a predicate that tests for multiple HTTP methods.
2018-07-06 12:01:16 +02:00
Arjen Poutsma 91e96d8084 Improve RouterFunction builder
This commit improves the RouterFunctions.Builder based on conversations
had during the weekly team meeting.

Issue: SPR-16953
2018-07-06 12:01:08 +02:00
Rossen Stoyanchev 5cdc26770e Correlated WebClient log messages
Issue: SPR-16966
2018-07-05 08:30:23 -04:00
Rossen Stoyanchev 82310660fd Correlated encoding/decoding log messages via hints
Issue: SPR-16966
2018-07-05 08:28:15 -04:00
Rossen Stoyanchev fd90b73748 Correlated WebFlux server log messages
Issue: SPR-16966
2018-07-05 08:27:13 -04:00
Rossen Stoyanchev 8bffb6a798 Add defaultRequest option to WebClient.Builder
Issue: SPR-16873
2018-07-03 12:44:29 -04:00
Rossen Stoyanchev da5b705328 Polish default headers/attributes in WebClient 2018-07-03 12:44:29 -04:00
Rossen Stoyanchev 907a306ee2 Fix locally failing test in FlushingIntegrationTests 2018-06-29 18:15:52 -03:00
Juergen Hoeller e22466e9d5 Polishing 2018-06-29 19:44:15 +02:00
Juergen Hoeller df6b01a329 Remove deprecated classes and methods from early 5.0.x phase 2018-06-29 19:44:08 +02:00
Juergen Hoeller d34e6f7f70 Polishing 2018-06-28 18:02:07 +02:00
Juergen Hoeller 8ad5299f4a Polishing 2018-06-28 17:12:29 +02:00
Juergen Hoeller 40efcc933c Polishing 2018-06-28 14:51:33 +02:00
Arjen Poutsma 794693525f Polishing 2018-06-28 14:09:34 +02:00
Arjen Poutsma a691065d05 Polishing 2018-06-28 11:27:30 +02:00
Arjen Poutsma 8202052b38 Introduce RouterFunction builder
This commit introduces RouterFunctions.Builder, a new way to build
router functions that does not require static imports, thus being more
discoverable and convenient.

Issue: SPR-16953
2018-06-28 11:23:38 +02:00
Phillip Webb a89e716cc7 Use tabs rather than spaces in tests
Update tests to ensure that tabs are used instead of spaces. Also
consistently apply a new line at the end of each file.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 1c25cec44f Polish test code
Polish a few issue identified when adding checkstyle to the
build. Although checkstyle is not enforcing rules on tests,
these are a few minor changes that are still worth making.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 81451aa800 Organize imports
Reorganize imports to ensure consistent ordering. This commit also
expands any `.*` static imports in favor of using fully-qualified
method references.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb b220d94cc2 Never use parenthesis for single lambda arguments
Update all lambdas that take a single argument so that parenthesis
are never used.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 5cedd0d5d4 Consistently use tabs rather than spaces
Update code that has accidentally used spaces instead of tabs.
Also remove all trailing whitespace.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 0b53c1096a Always use 'this.' when accessing fields
Ensure that `this.` is used consistently when accessing class
fields.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb eeebd51f57 Use consistent class design
Update all classes so that inner classes are always last. Also
ensure that utility classes are always final and have a private
constructor and make exceptions final whenever possible.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 0ad0f341bd Don't use single letter catch variables
Update existing catch blocks to ensure that `ex` is always used
in preference to `e` or `t` as the variable name.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb e9d1b39aff Apply consistent copyright header
Add copyright header to `package-info.java` files and fix a few
malformed headers on existing java files.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb c3a17dfd47 Ensure all files end with a newline
Update all files to ensure that they always end with a new line.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb e0480f75ac Fix javadoc checkstyle issues
Fix checkstyle violations for javadoc.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Napster 8aa6e5bfea Undertow WebSocket sessions use shared ByteBufferPool
Issues: SPR-16957
2018-06-25 17:46:25 -03:00
Rossen Stoyanchev 7ccd2b024d Refine logging for async requests
Issue: SPR-16898
2018-06-25 14:42:29 -03:00
Rossen Stoyanchev 900bc8a2e3 Logging improvements for WebFlux
Issue: SPR-16898
2018-06-22 22:44:24 -04:00
Brian Clozel 4a26f93a0d WebClient writes Content-Length for Mono bodies
In SPR-16892, the `EncoderHttpMessageWriter` has been improved to write
`"Content-Length"` HTTP response headers if the response body is of type
`Mono` (i.e. the actual content length is easily accessible without
buffering a possibly large response body). That change was relying on
the fact that the server side is using a `ChannelSendOperator` to delay
the writing of the body until the first signal is received.

This strategy is not effective on the client side, since no such channel
operator is used for `WebClient`. This commit improves
`EncoderHttpMessageWriter` and delays, for `Mono` HTTP message bodies
only, the writing of the body so that we can write the
`"Content-Length"` header information once we've got the body resolved.

Issue: SPR-16949
2018-06-19 11:51:45 +02:00
Rossen Stoyanchev 03c305136d Fix failing tests 2018-06-18 20:20:32 -04:00
Rossen Stoyanchev afa45950ff Polish ExchangeFilterFunction[s] 2018-06-13 17:14:49 -04:00
Juergen Hoeller 9c36b53833 Upgrade to JAXB 2.3.0.1, Aalto XML 1.1, Rome 1.10 2018-06-11 22:01:51 +02:00
Brian Clozel 417354da8a Remove dependency management noise from POMs
Prior to this commit, the generated POMs for Spring Framework modules
would contain unneeded/harmful information from the Spring Framework
build:

1. The BOM imports applied to each module by the dependency
management plugin, for example for Netty or Reactor Netty.
Spring should not export that opinion to its POMs.

2. The exclusion of "org.slf4:jcl-over-slf4j" from *all* dependencies,
which made the POMs much larger than necessary and suggested to
developers that they should exclude it as well when using all those
listed dependencies. In fact, only Apache Tiles currently brings that
transitively.

This commit removes that information from the POMs.
The dependencyManagement Gradle plugin is disabled for POM generation
and we manually resolve the dependency versions during the generation
phase.
The Gradle build is streamlined to exclude "org.slf4:jcl-over-slf4j"
only when necessary.

Issue: SPR-16893
2018-06-11 15:57:54 +02:00
Rossen Stoyanchev 86c861516d Accept Predicate instead of HandlerTypePredicate
Issue: SPR-16336
2018-06-08 15:32:07 -04:00
Rossen Stoyanchev 19dc981685 Path prefixes for groups of controllers
Issue: SPR-16336
2018-06-07 18:18:42 -04:00
Rossen Stoyanchev 72b1d4c648 Remove explicit references to Reactor Netty version
...now that 0.8 is also listed in the Reactor bom.

Issue: SPR-16387
2018-06-06 14:35:54 -04:00
Rossen Stoyanchev 3acb96efd0 CachingResourceResolver varies by known codings only
Issue: SPR-16381
2018-06-04 23:30:35 -04:00
Rossen Stoyanchev 010352163b Eliminate the need for Encoder#getContentLength
Issue: SPR-16892
2018-06-04 15:48:47 -04:00
Sebastien Deleuze f2ee18493f Make RouterFunctionDsl extensible
Issue: SPR-16897
2018-06-04 15:35:25 +02:00
Rossen Stoyanchev a3216432b5 Polish
Issue: SPR-16387
2018-05-31 15:38:30 -04:00
Violeta Georgieva ffbc75ae47 Upgrade to Reactor Netty 0.8
Issue: SPR-16387
2018-05-31 15:37:39 -04:00
Juergen Hoeller f3e860e8f1 Resource handler tests expect status 404 for directory in jar file
Issue: SPR-16832
2018-05-30 00:31:35 +02:00
Juergen Hoeller 69f14a2038 ClassPathResource.isReadable() checks InputStream (for jar directories)
Resource.isReadable() is defined to semantically imply exists() now.

Issue: SPR-16832
2018-05-29 21:47:33 +02:00
Juergen Hoeller 8593fec22c Avoid ConstantConditions warnings suppression (plus related polishing)
Issue: SPR-15756
2018-05-29 21:47:10 +02:00
Arjen Poutsma 8c30b8e628 Fix parent path variables in nested route functions
This commit fix an issue where path variables in a nested parent
RouterFunction were not committed to the request attributes.

Issue: SPR-16868
2018-05-29 15:48:31 +02:00
Rossen Stoyanchev 2acf91a438 Polish 2018-05-26 09:24:23 -04:00
Rossen Stoyanchev d77797f42c Improve readability of Body[Inserters|Extractors] 2018-05-25 13:32:00 -04:00
Rossen Stoyanchev 85e8634810 Properly initialize URI/Matrix vars w/ urlDecode=false
Issue: SPR-16867
2018-05-24 15:08:39 -04:00
Rossen Stoyanchev 82480a7908 Update docs on WebClient filters 2018-05-24 07:16:54 -04:00
Rossen Stoyanchev b472d192f4 Improve support for caching encoded resources
The key in CachingResourceResolver now includes the "Accept-Encoding"
request header cleaned to exclude "*", "identity", and parameters, and
also sorted alphabetically.

For encoded resources the response now includes a response header with
"Vary: Accept-Encoding".

Issue: SPR-16381
2018-05-23 09:17:21 -04:00
Rossen Stoyanchev 9274de390a Polish resource handling tests 2018-05-23 09:17:21 -04:00
Rossen Stoyanchev f121aa5e31 Immutable Resource[Resolver|Transformer]Chains
Issue: SPR-16862
2018-05-23 09:17:21 -04:00
Rossen Stoyanchev 5207672b3f Configurable support for static resource encodings
The new EncodedResourceResolver is a generalized version of
GzipResourceResolver that can be configured to support different
content codings, by "br" and "gzip".

GzipResourceResolver is now deprecated.

Issue: SPR-16381
2018-05-23 09:17:21 -04:00
Rossen Stoyanchev 1f8476aaf3 Add missing @param 2018-05-21 21:09:29 -04:00
Stephane Nicoll 36f8d49c4a Polish 2018-05-19 10:32:25 +02:00
Rossen Stoyanchev 192c7a5627 WebSession to WebSocketSession attribute passing
This commit makes it possible to pass attributes from the WebSession of
a handshake request to the WebSocketSession, by configuring a
Predicate<String> on HandshakeWebSocketService.

Issue: SPR-16212
2018-05-18 21:32:46 -04:00
Rossen Stoyanchev 9074828478 Add attributes to WebFlux WebSocketSession
Issue: SPR-16212
2018-05-18 21:32:46 -04:00
Juergen Hoeller 285eb94a03 Upgrade to Hibernate Validator 6.0.10 2018-05-18 22:22:12 +02:00
Juergen Hoeller 6710291bbd Polishing 2018-05-18 22:21:33 +02:00
Rossen Stoyanchev ade2eab169 Polish WebFlux WebSocket docs
Issue: SPR-16820
2018-05-17 10:02:54 -04:00
Arjen Poutsma b03905e2b0 Improve toString for filtered router function
Issue: SPR-16829
2018-05-17 12:32:57 +02:00
Rossen Stoyanchev 543f190239 Expand WebFlux docs with WebSocketHandler examples
Issue: SPR-16820
2018-05-16 21:30:31 -04:00
Rossen Stoyanchev 4ff4d5a181 Allow client-side use of BodyExtractors#toFormData
Issue: SPR-16804
2018-05-16 10:41:50 -04:00
Rossen Stoyanchev 18854ee544 Polish: simplify ControllerMethodResolver initialization 2018-05-16 10:03:57 -04:00
Arjen Poutsma 7424ca5790 Improve toString for query param and path extension predicates
Issue: SPR-16829
2018-05-16 11:14:21 +02:00
Rossen Stoyanchev 3af5f00ee7 UnsupportedMediaType[Status]Exception reports body type
Issue: SPR-16805
2018-05-14 23:16:36 -04:00
Rossen Stoyanchev 395792b302 Produces media types cleared prior to error handling
Issue: SPR-16318
2018-05-14 23:16:36 -04:00
Rossen Stoyanchev 6cf6d8834c List OPTIONS in OPTIONS responses for @RequestMapping
Issue: SPR-16513
2018-05-14 09:05:03 -04:00
Rossen Stoyanchev 23001a6c3d Update WebFlux RequestPart tests
Issue: SPR-16621
2018-05-14 09:03:14 -04:00
Rossen Stoyanchev 5cee607f28 WebFlux @RequestPart support for List and Flux arguments
The resolver now supports List<T>, Flux<T>, and List<Part>.

Issue: SPR-16621
2018-05-11 18:38:29 -04:00
Rossen Stoyanchev 15182b29a4 Add MockWebSession for use with MockServerWebExchange
Issue: SPR-16772
2018-05-11 10:53:28 -04:00
Rossen Stoyanchev 7f954ebc32 Inject UriComponentsBuilder relative to webapp root
Issue: SPR-16813
2018-05-11 09:52:02 -04:00
Rossen Stoyanchev 4da43de7e1 Remove individual detection of forwarded headers
This commit removes all places where forwarded headers are checked
implicitly, on an ad-hoc basis.

ForwardedHeaderFilter is expected to be used instead providing
centralized control over using or discarding such headers.

Issue: SPR-16668
2018-05-11 09:31:39 -04:00
Rossen Stoyanchev eef592d901 Add builder to MockServerWebExchange
Issue: SPR-16772
2018-05-10 15:16:13 -04:00
Rossen Stoyanchev 1aadf2c3a6 Refine compareTo for param and header conditions
Issue: SPR-16674
2018-05-08 18:12:51 -04:00
Juergen Hoeller 53aa9cc4cd Upgrade to Servlet API 4.0.1 (aligned with Tomcat 9 and Undertow 2)
Issue: SPR-16470
2018-05-07 14:17:28 +02:00
Juergen Hoeller 48807be482 Polishing 2018-05-05 15:16:08 +02:00
Juergen Hoeller c9f488363d Fine-tuned assertions and related polishing 2018-05-05 14:39:43 +02:00
Arjen Poutsma bfb2effddb Expose resource lookup function
This commit exposes the resource lookup function used by
`RouterFunctions.resources(String, Resource)`, so that it can be
composed upon.

Issue: SPR-16788
2018-05-04 13:36:24 +02:00
Arjen Poutsma 51325afbcc Clean up path variables after non match
This commit makes sure the nested path variables are only commited to
the attributes when all predicates match.

Issue: SPR-16692
2018-05-03 11:02:46 +02:00
Sebastien Deleuze af0cb53742 Support decoding Mono in Jaxb2XmlDecoder
Issue: SPR-16759
2018-05-02 12:10:46 +02:00
Arjen Poutsma 22edab852d Provide simple way to create ServerRequest
This commit introduces support for creating a new `ServerRequest` from
an existing instance. This is especially useful when filtering requests
in a HandlerFilterFunction.

Issue: SPR-16707
2018-05-02 10:54:00 +02:00
Rossen Stoyanchev 64b8b6e978 Polish WebSocketIntegrationTests 2018-05-01 14:26:21 -04:00
Rossen Stoyanchev 725d685799 ReactorNettyWebSocketSession implements close properly
Issue: SPR-16774
2018-05-01 12:04:37 -04:00
Sam Brannen de4b65a0f3 Suppress warnings in RequestMappingMessageConversionIntegrationTests 2018-04-30 12:05:34 +01:00
Juergen Hoeller 9bff5b48cf Fine-tuned assertions and related polishing in WebFlux builders 2018-04-27 23:36:58 +02:00
Johnny Lim 6519e7b22a Polish 2018-04-27 14:06:48 -04:00
Juergen Hoeller a683472daa Support for non-standard HTTP status in reactive ClientHttpResponse
Issue: SPR-16748
2018-04-27 18:25:11 +02:00
Johannes Edmeier 2a0540cb5f Move init of excchangeStrategies to default ctor in DefaultWebClientBuilder
When the copy constructor is used the exchangeStrategies need not to be
initialized as they are set in the copyconstructor

fixes SPR-16771
2018-04-26 10:28:38 +02:00
sdeleuze 1d6540b1c2 Enable KotlinScriptTemplateTests after KT-18833 fix 2018-04-23 14:49:22 +02:00
Rossen Stoyanchev b6da63aeb7 Align with 5.0.x change #cd3ed7 2018-04-19 13:50:55 -04:00
Rossen Stoyanchev da98ff72d2 Use StringDecoder to split SSE stream
ServerSentEventHttpMessageReader had logic to split on new lines
and buffer until an empty new line (start of a new event). To account
for random data chunking, it later re-assembled the lines for each
event and split again on new lines. However bufferUntil was still
unreliable a chunk may contain nothing but a newline, which doesn't
necessarily mean an empty newline in the overall SSE stream.

This commit simplifies the above by delegating the splitting of the
stream along newlines to StringDecoder.

Issue: SPR-16744
2018-04-19 11:29:12 -04:00