Commit Graph

1215 Commits

Author SHA1 Message Date
Sam Brannen
5a5f118efc Escape closing curly braces in regular expressions for Android support
PR gh-24470 introduced a regression for Android users by no longer
escaping closing curly braces in regular expressions.

This commit therefore partially reverts the changes made in 273812f9c5
for closing curly braces (`}`).

Closes gh27467
2021-10-01 10:56:00 +02:00
Juergen Hoeller
e31d66cd2b Polishing (backported from 5.3.x) 2021-09-02 23:18:36 +02:00
ShindongLee
3ab270e0f1 Fix parameter bug of handler inside the filterFunction DSL
Co-authored-by: hojongs <hojong.jjh@gmail.com>
Co-authored-by: bjh970913 <bjh970913@gmail.com>

Closes gh-26921
2021-05-10 10:22:13 +02:00
Sam Brannen
a33adac6c8 Support @ModelAttribute(binding=false) with WebFlux
Prior to this commit, @ModelAttribute(binding=false) was honored with
Spring Web MVC but not with WebFlux.

This commit adds support for disabling binding via @ModelAttribute with
WebFlux by adding a check to resolveArgument(...) in
ModelAttributeMethodArgumentResolver.

Closes gh-26856
2021-05-03 19:13:16 +02:00
Stephane Nicoll
30b5a7b5c3 Backport "Remove leftover Javadoc from WebClient"
Closes gh-26809
2021-04-15 09:57:21 +02:00
Juergen Hoeller
0fc831e8bd Polishing (backported from master) 2021-03-09 00:05:55 +01:00
Sam Brannen
31c5fc6417 Polish contribution
See gh-26619
2021-03-02 14:28:01 +01:00
GungnirLaevatain
e8f685ecc8 Ensure local @CrossOrigin maxAge overrides global value
Prior to this commit, a method-level @CrossOrigin maxAge value did not
override a class-level @CrossOrigin maxAge value. This contradicts the
Javadoc for @CrossOrgin which states the following.

    For those attributes where only a single value can be accepted such
    as allowCredentials and maxAge, the local overrides the global
    value.

This commit ensures that a method-level @CrossOrigin maxAge value
overrides a class-level @CrossOrigin maxAge value.

Closes gh-26619
2021-03-02 14:27:49 +01:00
Brian Clozel
9f7c8aea94 Fix ResourceUrlProvider handler auto-detection
Prior to this commit, `ResourceUrlProvider` would listen and consider
all `ContextRefreshedEvent` and use the given context to detect
`SimpleUrlHandlerMapping`.

This could lead to situations where a `ResourceUrlProvider` uses another
application context than its own (in a parent/child context setup) and
detect the wrong set of handlers.

Because `ResourceUrlProvider` locks itself once the auto-detection is
done, we need to ensure that it considers only events sent by its
application context.

Fixes gh-26562
2021-02-17 22:10:29 +01:00
Juergen Hoeller
f011e58f90 Polishing 2020-12-17 11:05:58 +01:00
Rossen Stoyanchev
37bda566eb Allow "*" for Access-Control-Expose-Headers
Closes gh-26113
2020-11-19 09:48:41 +00:00
Juergen Hoeller
cde95e1446 Polishing 2020-11-09 13:52:34 +01:00
Arjen Poutsma
0acb1e5513 Copy default headers, cookies in WebClient builder
This commit makes copies of the default headers and cookies when a
WebClient is built, so that subsequent changes to these do not affect
previously built clients.

Closes: gh-25992
2020-10-29 13:36:26 +01:00
Rossen Stoyanchev
bb4e802af5 Full header support HTTP HEAD Resource requests
Allow the body to be written in order for all headers to be set
as they would be on HTTP GET. The body content is ignored as a
lower level.

See gh-25976
2020-10-27 11:14:37 +00:00
Rossen Stoyanchev
d91b66a04c Allow Resource to add headers for range requests
Closes gh-25976
2020-10-27 10:15:56 +00:00
Sam Brannen
449377908f Fix JUnit 4 to AssertJ migration bugs
The migration from JUnit 4 assertions to AssertJ assertions resulted in
several unnecessary casts from int to long that actually cause
assertions to pass when they should otherwise fail.

This commit fixes all such bugs for the pattern `.isNotEqualTo((long)`.
2020-10-26 14:53:09 +01:00
Juergen Hoeller
f3f19504c6 Polishing 2020-10-13 00:21:07 +02:00
Juergen Hoeller
72b2dda17f Avoid creation of unused logger instance in AbstractMediaTypeExpression
Closes gh-25901
2020-10-13 00:20:06 +02:00
Juergen Hoeller
e176c4e799 Polishing 2020-10-12 19:40:50 +02:00
Juergen Hoeller
66a67ec807 Polishing 2020-10-12 18:26:14 +02:00
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