Commit Graph

1899 Commits

Author SHA1 Message Date
Juergen Hoeller e46ccd74b1 Consistent abstract declaration of "Abstract" base classes
Closes gh-25240
2020-06-11 23:43:41 +02:00
Rossen Stoyanchev a2d516d526 Replace "whitelist" with alternative words 2020-06-08 21:19:28 +01: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 7c9ad6dd08 Add deprecation notes to the WebMvc config schema
Closes gh-23915
2020-05-12 06:50:09 +01:00
Rossen Stoyanchev 583435d068 Consistent ordering in MethodNotAllowedException
This caused random failures in a newly added test. Also remove defensive
check in ResponseStatusExceptionResolver.

See gh-24944
2020-04-25 07:33:30 +01:00
Rossen Stoyanchev e18901d6b1 Headers support in ResponseStatusExceptionResolver
Closes gh-24944
2020-04-24 12:53:00 +01:00
Rossen Stoyanchev 8d31dcaa29 Clarification on path extension deprecations
Closes gh-24642
2020-04-20 14:43:07 +01:00
Sébastien Deleuze 884c7696ce Make it possible to run Spring MVC without kotlin-reflect
Closes gh-24828
2020-04-14 14:56:47 +02:00
Juergen Hoeller de0d06fab5 Polishing 2020-04-09 11:49:35 +02:00
Qimiao Chen fd8d11c7e3
Use single String instead of String[] for varargs argument
Closes gh-24864
2020-04-04 20:05:19 +02:00
陈其苗 13970ae528 Use autoboxing instead of explicit wrapping in tests
Closes gh-24801
2020-04-01 14:34:20 +02:00
Sam Brannen e26764d249 Remove duplicate words in documentation and polish Javadoc 2020-03-31 12:17:58 +02:00
Juergen Hoeller 910d2788e9 Polishing 2020-03-23 18:02:55 +01:00
Juergen Hoeller 1800b10717 Expose parameter annotations from interfaces across entire class hierarchy
Closes gh-24127
2020-03-23 17:57:44 +01:00
Sam Brannen 35d0b3dba9 Fix Javadoc links accidentally broken in 7b6d83a106 2020-03-16 15:43:04 +01:00
Qimiao Chen 193a76fe2a
Avoid unnecessary sorting in AbstractHandlerMethodMapping
Closes gh-24704
2020-03-16 12:38:43 +01: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
Rossen Stoyanchev 7b7dfcaaed Polishing contribution
See gh-24691
2020-03-13 14:58:01 +00:00
mdindoffer c11dd4a839
Do not mention credentials as enabled by default in CorsRegistry
Credentials are not enabled by default contrary to the javadocs. 
The credentials support must be enabled via #allowCredentials.

Closes gh-24691

Co-authored-by: Martin Dindoffer <martin.dindoffer@sigp.eu>
2020-03-13 15:21:53 +01: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 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
Arjen Poutsma 2fb90cb16b Support for byte-range requests in WebMvc.fn
This commit introduces support for byte-range requests in Servlet
Functional endpoints.

Closes gh-24562
2020-03-05 15:32:31 +01:00
Rossen Stoyanchev 7e03728b2c Polishing contribution
See gh-24632
2020-03-04 19:27:37 +00:00
sada-sigsci cc1f57823b Remove charset from content-type in SseEmitter
See gh-24632
2020-03-04 19:27:37 +00:00
Rossen Stoyanchev a98bf30ee6 ShallowEtagHeaderFilter checks for pre-existing eTag
The filter now checks for an explicitly set eTag and uses it instead of
generating one, and also suppresses caching.

Closes gh-24635
2020-03-04 19:17:56 +00:00
Rossen Stoyanchev c7e037da39 Remove unnecessary calls to disableContentCaching
These calls were added in error when trying to fix #22797 and #23775.
They are not needed in 304 scenarios. Those have no response content and
are skipped by ShallowETagHeaderFilter based on the status.

This leaves disableContentCaching invoked only in streaming scenarios,
which was the original intent and should be the only reason for that
method.

See gh-24635
2020-03-04 19:17:56 +00:00
Rossen Stoyanchev d3da7a50ec Polishing and minor refactoring
See gh-24635
2020-03-04 19:17:56 +00:00
Christoph Dreis 2093e35f27 Avoid unnecessary sorting 2020-03-04 19:10:14 +00:00
ZhangT c5fb7b9fb7
Simplify some redundant code
Closes gh-24586

Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2020-02-26 12:29:09 +01:00
Juergen Hoeller 6db20eb773 Avoid package import cycles 2020-02-25 14:55:53 +01:00
Rossen Stoyanchev 68b980f849 Remove producible request attribute before mapping
The attribute was previously removed only before exception resolution
in the DispatcherServlet in order to allow error rendering to make an
independent choice on content negotation.

However, Boot rendering happens later in an ERROR dispatch which could
also be a nested dispatch on some servers. So the attribute must also
generally be removed prior to mapping.

We also move the methods where this is done to the base
RequestMappingInfoHandlerMapping class which also deals with the
produces condition and where the producible attribute is added in the
first place.

Closes gh-24466
2020-02-18 21:50:38 +00:00
Rossen Stoyanchev 9aea10179b Insert StringMessageConverter for SSE
Closes gh-24465
2020-02-05 20:49:07 +00:00
Rossen Stoyanchev e7d40f930f Remove synchronized block
As per the Javadoc of ConcurrentHashMap its computeIfAbsent
implementation is atomic and hence already synchronized internally,
so we can remove the surrounding synchronization block.

See gh-24470
2020-02-03 20:59:30 +00:00
Hyunjin Choi bac5cd866e Simplify getSessionAttributesHandler() method 2020-02-03 20:43:45 +00:00
Hyunjin Choi a2af5a90dc Simplify UrlFileNameViewController#getViewNameForUrlPath()
Closes gh-24419
2020-01-24 11:39:05 +01:00
Rossen Stoyanchev c69703ffdb Deprecate path extension strategies
This commit deprecates PathExtensionContentNegotiationStrategy and
ServletPathExtensionContentNegotiationStrategy and also updates code
that depends on them internally to remove that dependence.

See gh-24179
2020-01-22 13:35:09 +00:00
Rossen Stoyanchev 214ba63127 Deprecate config options for content negotiation by path extension
See gh-24179
2020-01-22 13:35:09 +00:00
Rossen Stoyanchev 7453c0d0cb Deprecate config options to match by path extension
See gh-24179
2020-01-22 13:35:09 +00:00
Rossen Stoyanchev 8740c2dc18 Warning against split URL handling in docs
Closes gh-24304
2020-01-13 21:33:11 +00:00
Sébastien Deleuze bc7d010485 Update CORS support
This commit updates CORS support in order to check Origin header
in CorsUtils#isPreFlightRequest which does not change how Spring
MVC or WebFlux process CORS request but is more correct in term
of behavior since it is a public API potentially used in another
contexts.

It also removes an unnecessary check in
AbstractHandlerMethodMapping#hasCorsConfigurationSource and processes
every preflight request with PreFlightHandler.

Closes gh-24327
2020-01-13 08:33:14 +01:00
Rossen Stoyanchev 34d32402d3 Return 500 if producible attribute present
When a request is mapped through a producible condition on an
@RequestMapping, then a failure to find a converter/decoder should be
a 500 because the return type + media type pair were declared by the
controller and that should be possible to render.

Closes gh-23287
2020-01-09 11:10:44 +00:00
Rossen Stoyanchev d509d5ae6f Polishing contribution
See gh-24143
2020-01-08 16:47:33 +00:00
Astushi Yoshikawa 53b39eb753 MvcUriComponentsBuilder prepends slash
See gh-24143
2020-01-08 16:47:33 +00:00
Sam Brannen ef6b1ba034 Update copyright date 2020-01-07 17:15:23 +01:00
stsypanov c480a99a77 Trim line from LineInfo only once 2020-01-07 14:44:09 +01:00