Commit Graph

19930 Commits

Author SHA1 Message Date
Rossen Stoyanchev
246e72ff2f Refactor WebTestClient exchange mutator support
This commit factors ServerWebExchange mutator support out of
WebTestClient in favor of an independent public class called
MockServerExchangeMutator which implements WebFilter and can be
applied to the WebTestClient as any other WebFilter.

The MockServerExchangeMutator also exposes a method to apply
a client-side filter for "per request" mutators. See the Javadoc
of the MockServerExchangeMutator.

Issue: SPR-15570
2017-05-24 14:03:57 -04:00
Arjen Poutsma
a5b94f3a77 Use HttpRequest.getMethodValue
This commit uses the newly introduced HttpRequest.getMethodValue in
the webflux module.

Issue: SPR-15545
2017-05-24 17:19:43 +02:00
Arjen Poutsma
630fc194f0 Add HttpRequest.getMethodValue
This commit introduces a new method in HttpRequest:
`String getMethodValue`, which returns the HTTP method as a String.
Furthermore, HttpRequest.getMethod() has been given a default
implementation using this String value in combination with
`HttpMethod.resolve`.

Issue: SPR-15545
2017-05-24 16:36:58 +02:00
Arjen Poutsma
31d1e26c95 Use List<T> instead of Supplier<Stream<T>>
This commit changes all methods that return `Supplier<Stream<T>` to
return `List<T>` instead. This includes the HandlerStrategies, but also
BodyInserter.Context, BodyExtractor.Context, and ServerResponse.Context.

The reason for this change is that most of the strategies have some sort
of order, where more specific message readers - for instance - come
before generic ones. Such an ordering can only be enforced through a
List.

Issue: SPR-15578
2017-05-24 13:48:03 +02:00
Arjen Poutsma
01e3561db9 Support RouterFunction in @EnableWebFlux
This commit removes the RouterFunctions.toHandlerMapping method, in
favor of native support for RouterFunctions in @EnableWebFlux
configuration classes.

In order to accomplish this, the HandlerStrategies components has been
repurposed to only be used for the "bare-bones" HttpHandler, while the
(newly introduced) RouterFunctionMapping uses the strategies as exposed
through WebFluxConfigurationSupport.

Furthermore, this commit also introduces support for testing
RouterFunctions without resorting to an application context.

Issue: SPR-15536
2017-05-24 11:42:15 +02:00
skarafaz
3d290165fb Find exact matches in WebJarsResourceResolver
Prior to this commit, resolving resources from webjars using the
`WebJarAssetLocator.getFullPath` could lead to multiple candidates,
since this method is trying to find *any* resource matching that path
under the given webjar location.

This commit replaces that call with
`WebJarAssetLocator.getFullPathExact`, which avoids those multiple
matches and only resolves resources if the given path is exact.

Issue: SPR-15526
(cherry picked from commit e2aa117ff9)
2017-05-24 10:46:35 +02:00
Rossen Stoyanchev
3f32f72bfc Polish
SPR-15576
2017-05-23 21:57:34 -04:00
Juergen Hoeller
0183576215 Polishing 2017-05-23 22:05:22 +02:00
Juergen Hoeller
db69a082d9 Avoid java.util.Optional signatures for simple field access
Issue: SPR-15576
2017-05-23 22:05:15 +02:00
Juergen Hoeller
ce5e2b94c4 ProtobufJsonFormatHttpMessageConverter for configurable JSON processing
Issue: SPR-15550
2017-05-23 21:59:23 +02:00
Juergen Hoeller
113f0fb13f Javadoc suggests Jackson 2.9
Issue: SPR-14925
2017-05-23 21:59:16 +02:00
Rossen Stoyanchev
b6e252495a Protect against NPE in DefaultSubscriptionRegistry
Follow-up fix on the recent commit:
https://github.com/spring-projects/spring-framework/commit/44c31a

Issue: SPR-15543
2017-05-22 16:08:34 -04:00
Stephane Nicoll
b64de87a6b Merge pull request #1411 from andreykaipov:patch-2
* pr/1411:
  Minor typo fix: form -> from
2017-05-20 14:50:18 +02:00
Andrey Kaipov
9c226aa742 Minor typo fix: form -> from
Closes gh-1411
2017-05-20 14:49:54 +02:00
Rossen Stoyanchev
11075f12bc Fix URI parsing in Reactor Netty request
Issue: SPR-15560
2017-05-19 21:47:27 -04:00
Juergen Hoeller
c59e192b0f Upgrade to Kotlin 1.1.2-4 (and Undertow 1.4.15) 2017-05-19 23:23:11 +02:00
Rossen Stoyanchev
34f1712d59 Merge pull request #1422 from svorcmar/SPR-15505 2017-05-19 17:00:16 -04:00
Rossen Stoyanchev
48a5938cd4 Polish 2017-05-19 16:59:36 -04:00
Martin Švorc
bf83e4e861 Use original query string of forwarded request
Prior to this commit, the AbstractFlashMapManager has used the
originating URI but the query string of the forwarded request. That
resulted to FlashMap not being matched even when both originating
URI and query string matched the FlashMap attributes. The originating
query string is now used to match the forwarded request.

Issue: SPR-15505
2017-05-19 16:49:29 -04:00
Bao Tran
44c31a6aad Fix duplicate STOMP subscription id issue
Issue: SPR-15543
2017-05-19 15:20:14 -04:00
Juergen Hoeller
cb3d1befcd LocalValidatorFactoryBean properly supports unwrap at ValidatorFactory level
Also documents limitation for Bean Validation 2.0's getClockProvider() method.

Issue: SPR-15561
Issue: SPR-13482
2017-05-18 21:00:56 +02:00
Juergen Hoeller
67881a5726 Polish PathPattern parser (including package change to web.util.pattern)
Issue: SPR-15531
2017-05-17 17:40:25 +02:00
Juergen Hoeller
eaac348c05 Close InputStreams in writeResourceRegionCollection (analogous to writeResourceRegion)
Issue: SPR-15559
2017-05-17 14:34:50 +02:00
Juergen Hoeller
7b3f5fd855 ResourceUtils.extractArchiveURL properly deals with top-level war URLs
Issue: SPR-15556
2017-05-17 14:22:43 +02:00
Juergen Hoeller
e835f4d025 Revised png and jpeg mappings
Issue: SPR-15546
Issue: SPR-15557
2017-05-17 14:21:44 +02:00
Arjen Poutsma
ba39697f2e Expose Principal in ServerRequest
This commit exposes the Principal in ServerRequest.

Issue: SPR-15552
2017-05-16 14:50:57 +02:00
Juergen Hoeller
94efbe2687 Latest dependency updates (OkHttp 3.8, Protobuf 3.3.1, Rome 1.7.3, Tomcat 8.5.15) 2017-05-16 11:39:21 +02:00
Juergen Hoeller
9e3f4ccce9 Merge pull request #1394 from alexander-riss/keySet
Fix inefficient use of keySet operators in messaging classes

Issue: SPR-15553
2017-05-16 11:22:22 +02:00
Alexander Riss
e49a5d8424 fix inefficient use of keySet operators in messaging classes
issue: SPR-15553
2017-05-16 10:41:22 +02:00
Rossen Stoyanchev
5ac7955de9 More qualified "request-id" header in WebTestClient
Issue: SPR-15501
2017-05-15 15:52:50 -04:00
Violeta Georgieva
7f616c216b Specify the HandlerMapping#order in the websocket example
The order value has to be specified for the HandlerMapping
so that it will be ordered before the one that serves the static resource.
2017-05-12 20:45:27 +03:00
Juergen Hoeller
f985f71daf Polishing 2017-05-12 12:50:17 +02:00
Juergen Hoeller
650a682659 Upgrade to Netty 4.1.11 2017-05-12 12:50:10 +02:00
Arjen Poutsma
f4cf55cb2b Add support for WebFilter and WebExceptionHandler
This commit adds support for configuring `WebFilter` and
`WebExceptionHandler` instances in HandlerStrategies. It also drops the
"native" support for `ResponseStatusException`s, in favor of the
`ResponseStatusExceptionHandler`, which is registered by default.

Issue: SPR-15518
2017-05-11 11:45:00 +02:00
Arjen Poutsma
ad9cf99420 ResourceHandlerFunction returns EntityResponse
The ResourceHandlerFunction now returns an `EntityResponse<Resource>`
(instead of a `ServerResponse`), so that filters can inspect/change the
returned Resource.
2017-05-11 11:45:00 +02:00
Arjen Poutsma
8db4b2f7ed Remove synchronized block around PathPatternParser
Removed the synchronized block around PathPatternParser, since it is
now thread-safe.
2017-05-11 09:55:20 +02:00
Sebastien Deleuze
285fa1cc2c Fix typos in Kotlin extensions documentation 2017-05-10 17:22:27 +02:00
Arjen Poutsma
f0f3df5cc0 Use PathPattern in PathResourceLookupFunction 2017-05-10 10:12:55 +02:00
Arjen Poutsma
64c0ec3d5e Add test for combining @Controller with RouterFunctions
This commit adds a test for combining RouterFunctions with a
@Controller.

Issue: SPR-15521
2017-05-09 16:38:30 +02:00
Juergen Hoeller
9273197f11 Latest dependency updates (Common Annotations 1.3, Caffeine 2.5, Selenium 3.4, JSONassert 1.5) 2017-05-09 13:48:05 +02:00
Arjen Poutsma
b649041976 Add ServerHttpResponse.addCookie method
This commit adds a `addCookie(ResponseCookie)` method to the reactive
`ServerHttpResponse` interface.

Issue: SPR-15523
2017-05-09 10:18:39 +02:00
Rossen Stoyanchev
add1305252 Re-add vararg options in WebHttpHandlerBuilder
WebHttpHandlerBuilder is low level not expected to appear frequently
but they might be repeated more in tests (e.g. of WebFilter's).

Issuse: SPR-15499
2017-05-08 15:50:27 -04:00
Rossen Stoyanchev
459457e1aa WebFilterChain delegation nested in Mono.defer()
Issue: SPR-15520
2017-05-08 15:36:31 -04:00
Rossen Stoyanchev
47d6e4a332 Immutable DefaultWebFilterChain
Issue: SPR-15517
2017-05-08 15:04:38 -04:00
Juergen Hoeller
5497416c2d Polishing 2017-05-08 09:10:36 +02:00
Juergen Hoeller
f25c6ba9bc Polishing 2017-05-07 22:59:25 +02:00
Juergen Hoeller
c735eec08b Merge pull request #1421 from kazuki43zoo/patch-javadoc
Fix javadoc of AbstractHandlerMapping#setPathMatcher
2017-05-07 22:58:04 +02:00
Kazuki Shimizu
df793392fd Fix javadoc of AbstractHandlerMapping#setPathMatcher 2017-05-08 05:52:15 +09:00
Juergen Hoeller
92f18a4985 HandlerExecutionChain.toString() includes reliable interceptor number
Issue: SPR-15525
2017-05-07 21:05:16 +02:00
Juergen Hoeller
25aef4d3cc ResponseStatusException reason is optional (with lazily constructed message)
Issue: SPR-15524
2017-05-06 12:53:03 +02:00