Commit Graph

1195 Commits

Author SHA1 Message Date
Sébastien Deleuze b322cbd625 Add missing @Nullable to WebFlux RequestMappingHandlerMapping
Closes gh-25657
2020-09-25 14:22:53 +02:00
Rossen Stoyanchev 852718ec0e Minor fix in PathResourceResolverTests
Closes gh-25671
2020-09-13 21:09:08 +01:00
Juergen Hoeller cf2e0c7959 Selected use of ArrayList instead of LinkedList in common places
See gh-25652
2020-08-27 14:14:44 +02:00
Juergen Hoeller 6f0461c569 Polishing 2020-08-25 16:17:22 +02:00
Juergen Hoeller 8dd285f877 Polishing 2020-08-07 13:02:43 +02:00
Sam Brannen 335c3d5db6 Polish contribution
See gh-25445
2020-07-22 17:26:59 +02:00
XenoAmess ab859fcc96 Refine use of substring operations
Closes gh-25445
2020-07-22 17:26:42 +02:00
Rossen Stoyanchev 913eca9e14 ReactorNettyRequestUpgradeStrategy uses unique builder per request
See gh-25315
2020-07-20 17:55:23 +03:00
Juergen Hoeller 0b697a3068 Polishing 2020-07-17 19:24:23 +02:00
Juergen Hoeller e9898f7d52 Polishing 2020-07-17 17:48:33 +02:00
Sam Brannen 972c01cbbd Replace "blacklist" with alternative words
See gh-25262
2020-06-17 14:00:26 +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 d14140da69 Polishing 2020-06-06 13:21:46 +02: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
Rossen Stoyanchev a92f425529 Also use constant for custom mapping condition
See gh-25143
2020-05-28 06:51: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 d7a29bbcef DefaultClientResponseBuilder copies logPrefix
Closes gh-25069
2020-05-23 10:41:07 +01: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
Juergen Hoeller af65b1ca62 Polishing 2020-04-25 16:37:16 +02:00
mattbertolini 21887ad23b Allow override of data binder binding
Motivation
----------
The Spring MVC ModelAttributeMethodProcessor includes many helpful
extension methods that allow developers to extend and enhance the data
binding capabilities of the class. Unfortunately, Spring WebFlux's
equivalent class, the ModelAttributeMethodArgumentResolver, does not
include these same extension methods. I am leveraging these extension
methods, specifically the bindRequestParameters method, to provide
valuable enhancements to my application. I would like to provide these
same enhancements to the WebFlux portion of my application and am
unable to do so at this time. I would like to update the WebFlux
ModelAttributeMethodArgumentResolver to add the bindRequestParameters
method.

Modifications
-------------
I created a new method called bindRequestParameters and encapsulated
the WebExchangeDataBinder bind call inside of it. This method is
marked as protected as it should only be used by children of this
class. This change mirrors the behavior in the equivalent Spring MVC
class (ModelAttributeMethodProcessor).

Result
------
The WebFlux ModelAttributeMethodArgumentResolver can now accept
alternative data binding implementations mirroring the Web MVC
behavior.
2020-04-25 16:27:36 +02:00
Rossen Stoyanchev d9262b8a0c Suppress deprecated Reactor Netty call
See gh-24892
2020-04-24 12:57:16 +01:00
Rossen Stoyanchev 0520ee0fb6 Use the Reactor Netty WebsocketServerSpec
Closes gh-24959
2020-04-23 13:50:00 +01:00
Sam Brannen e26764d249 Remove duplicate words in documentation and polish Javadoc 2020-03-31 12:17:58 +02:00
Rossen Stoyanchev a606fb4b21 Fix checkstyle errors 2020-03-26 22:02:32 +00:00
Rossen Stoyanchev 3175f0771e Remove dumpString from DataBufferTestUtils
See gh-24786
2020-03-26 21:42:12 +00:00
Сергей Цыпанов f17b0125ff Simplify conversion of DataBuffer to String
See gh-24786
2020-03-26 21:42:12 +00:00
Rossen Stoyanchev 1822f272c7 toBodilessEntity() actually drains response body
See gh-24788
2020-03-26 15:59:28 +00:00
Rossen Stoyanchev 5309757026 WebClientIntegrationTests refactoring
- consistent test naming
- grouping by category and logical ordering within category
- consolidate overlapping tests
- polishing

See gh-24788
2020-03-26 15:59:04 +00:00
Rossen Stoyanchev d1cf16320b Minor refactoring and polishing in WebClientUtils
See: gh-24788
2020-03-26 15:59:04 +00:00
Rossen Stoyanchev 9685380334 Fix typos 2020-03-20 21:14:56 +00:00
Sam Brannen 331b14bb0b Fix NoHttp violation 2020-03-20 19:43:00 +01:00
Rossen Stoyanchev 2ca93cbe1c Update Javadoc for WebClient onStatus handlers
Closes gh-24736
2020-03-20 18:02:18 +00:00
Rossen Stoyanchev 0d42a1bd7f Add retry for flaky test (suspected Tomcat issue) 2020-03-19 14:32:56 +00:00
Arjen Poutsma 7c4f0318bb Improve efficiency of built RouterFunction
This commit changes the way RouterFunctions registered to the builder
are composed in both WebFlux.fn and WebMvc.fn.
Prior to this commit, all routes added to the build were composed with
`reduce`.
After this commit, all routes are stored in a special router function,
allowing for more efficient execution and smaller stack traces.

Closes gh-24652
2020-03-13 16:09:41 +01:00
Arjen Poutsma 54e2df2e0e Improve RouterFunction composition
This commit changes the way two RouterFunctions are composed in
WebFlux.fn. Prior to this commit, two were composed with
`switchIfEmpty()`, switching from the first to the second route if the
first did not provide an element.
After this commit, two router functions are compose using `concat`,
which results in a smaller stack trace.

See gh-24652
2020-03-13 16:09:41 +01:00
Rossen Stoyanchev 7b7dfcaaed Polishing contribution
See gh-24691
2020-03-13 14:58:01 +00:00
Arjen Poutsma 0dc1c7eb8b Add ServerRequest::checkNotModified
This commit adds the checkNotModified method to ServerRequest in both
WebFlux.fn and WebMvc.fn. Unlike other checkNotModified methods found
in the framework, this method does not return a boolean, but rather
a response wrapped in a Mono/Optional. If the resource has
not been changed, the not-modified response can be returned directly;
if the resource has changed, the user can create a corresponding
response using switchIfEmpty/orElse(Get).

Closes gh-24173
2020-03-11 16:45:00 +01:00
Arjen Poutsma 61569003b5 CORS support in HTTP header predicate
This commit introduces CORS support for the HeadersPredicate in
WebMvc.fn and WebFlux.fn.

Closes gh-24564
2020-03-10 17:22:26 +01:00
Arjen Poutsma 3cbea86335 Deprecate MockServerRequest
Deprecate MockServerRequest in favor of ServerRequest::create
combined with a MockServerWebExchange.
2020-03-10 15:45:11 +01:00
Arjen Poutsma c03cdbac21 CORS support in HTTP method predicate
This commit introduces CORS support for the HttpMethodPredicate in
WebMvc.fn and WebFlux.fn.

Closes gh-24564
2020-03-10 15:45:11 +01:00
Arjen Poutsma fc12891006 Add ServerRequest::firstHeader
This commit introduces the method firstHeaderiin both WebMvc.fn and
WebFlux.fn, which return the first header value of a given header name,
if any.
2020-03-10 15:45:11 +01:00
Christoph Dreis 2093e35f27 Avoid unnecessary sorting 2020-03-04 19:10:14 +00:00
陈其苗 8a7bb49436 Improve WebClient.Builder Javadoc 2020-02-28 17:07:58 +00:00
Rossen Stoyanchev 5f1e4ffc4f WebClient.Builder javadoc updates
Closes gh-24611
2020-02-28 15:55:53 +00:00
Juergen Hoeller c0fbf6fca1 Polishing 2020-02-24 19:50:12 +01:00
Brian Clozel f048f27d80 Configure Reactor Netty quiet shutdown period in tests
See gh-24538
2020-02-24 18:15:59 +01:00
Hyunjin Choi ede2a1d4b2 Remove unnecessary semicolon in some enum classes 2020-02-24 14:56:12 +01:00