Commit Graph

3553 Commits

Author SHA1 Message Date
Johnny Lim dfc8406917
Polish contribution
See gh-26462
Closes gh-26586
2021-02-22 11:05:25 +01:00
Sam Brannen 5b97c47fc4 Sync changes in MockHttpServletResponse test fixture
See gh-26558
2021-02-17 14:32:39 +01:00
Juergen Hoeller ca8261cbf8 Polishing 2021-02-15 17:18:01 +01:00
Stephane Nicoll 582559dd9e Polish "Allow customer resolver and property sources"
See gh-26462
2021-02-15 16:53:18 +01:00
Phillip Webb d4c609f2f0 Allow customer resolver and property sources
Add factory methods to `AbstractEnvironment` that allow a custom
`ConfigurablePropertyResolver` and `MutablePropertySources` instance
to be used.

See gh-26462
2021-02-15 16:53:18 +01:00
Sébastien Deleuze 9c6b1b645d Prevent kotlinx.serialization usage on collection of interfaces
Closes gh-26371
2021-02-15 14:44:54 +01:00
Rossen Stoyanchev 0fc8bf654b Expose DispatcherHandler as PreFlightRequestHandler
Closes gh-26257
2021-02-15 12:59:03 +00:00
Juergen Hoeller df977a2fd2 Nullability refinements and related polishing 2021-02-14 17:57:32 +01:00
Rossen Stoyanchev 1c6bab23ea Polishing
See gh-26434
2021-02-11 21:26:37 +00:00
Rossen Stoyanchev 3e502d4739 Document removal of duplicate slashes in UriComponentsBuilder
Closes gh-26457
2021-02-11 20:57:03 +00:00
Rossen Stoyanchev 8791928f61 Update variable detection in UriComponentsBuilder#encode
This commit better aligns how URI variable placeholders are detected
in UriComponentsBuilder#encode (i.e. the pre-encoding of the literal
parts of a URI template) and how they are expanded later on.
The latter relies on a pattern that stops at the first closing '}'
which excludes the possibility for well-formed, nested placeholders
other than variables with regex syntax, e.g. "{year:\d{1,4}}".

UriComponentsBuilder#encode now also stops at the first closing '}' and
further ensures the placeholder is not empty and that it has '{' before
deciding to treat it as a URI variable.

Closes gh-26466
2021-02-11 08:34:06 +00:00
Stephane Nicoll 87c0e9b48a Update copyright of change file
See gh-26538
2021-02-11 08:58:50 +01:00
izeye 9a4164c4a8 Polish
See gh-26538
2021-02-11 08:57:32 +01:00
Rossen Stoyanchev 53cafe728c Support to customize rather than replace default codecs
See gh-26212
2021-02-09 18:40:00 +00:00
Rossen Stoyanchev 26000ee29f Polishing contribution
Closes gh-26502
2021-02-08 17:35:59 +00:00
Christophe Maillard 0c2c66b38b Add HttpHandlerDecoratorFactory
See gh-26502
2021-02-08 15:47:21 +00:00
Rossen Stoyanchev f7c952cb3e Polishing contribution
Closes gh-26512
2021-02-05 13:28:19 +00:00
ascopes 6bc7e12bcd Fix typos in ResponseEntity Javadoc
See gh-26512
2021-02-05 13:28:19 +00:00
Rossen Stoyanchev 8fb9796d1d Polishing contribution
Closes gh-26463
2021-02-05 12:16:59 +00:00
Yusuke Yamamoto a264013d7a Content-Disposition can parse BASE64 encoded filename
See gh-26463
2021-02-05 12:16:59 +00:00
Rossen Stoyanchev 0d16c9100a MIME types by Class for Encoder, Decoder, HttpMessageReader|Writer
Closes gh-26212
2021-02-04 16:12:57 +00:00
Rossen Stoyanchev 7cdaaa22bd Extra ObjectMapper registrations in Jackson2CodecSupport
See gh-26212
2021-02-04 16:12:57 +00:00
Rossen Stoyanchev f4c9f6b860 Media types by Class for HttpMessageConverter
See gh-26212
2021-02-04 16:12:57 +00:00
Rossen Stoyanchev 1721b0b8d7 Extra ObjectMapper registrations in HttpMessageConverter
See gh-26212
2021-02-04 16:12:57 +00:00
Rossen Stoyanchev c52526ad42 Fix in MockMultipartHttpServletRequest#getMultipartHeaders
Previously this method returned headers only when a Content-Type part header
was present. Now it is guaranteed to return headers (possibly empty) as long
as there is a MultipartFile or Part with the given name.

Closes gh-26501
2021-02-03 21:55:42 +00:00
Toshiaki Maki 0575e6637c Protobuf Codec supports application/vnd.google.protobuf 2021-02-02 16:55:10 +00:00
Sam Brannen 99bd8115dd Clean up deprecation warnings in Gradle build output 2021-02-02 11:37:30 +01:00
Sam Brannen 1a3ff83157 Remove obsolete code in HeaderValueHolder 2021-02-02 11:28:32 +01:00
Sam Brannen c19b2851f1 Ignore null Locale in MockHttpServletResponse
Prior to this commit, calls to setLocale() MockHttpServletResponse
would result in a NullPointerException if the supplied Locale was null.

Although the Javadoc for setLocale(Locale) and addHeader(String, String)
in javax.servlet.ServletResponse does not specify how a null
Locale should be handled, both Tomcat and Jetty simply ignore a null
value.

This commit therefore updates MockHttpServletResponse to silently
ignore a null Locale passed to setLocale().

Closes gh-26493
2021-02-02 11:18:34 +01:00
Sam Brannen 3b4a3431d4 Ignore null header value in MockHttpServletResponse
Prior to this commit, calls to setHeader() and addHeader() in
MockHttpServletResponse would result in an IllegalArgumentException or
NullPointerException if the supplied header value was null.

Although the Javadoc for setHeader(String, String) and
addHeader(String, String) in javax.servlet.http.HttpServletResponse
does not specify how a null header value should be handled, both Tomcat
and Jetty simply ignore a null value. Furthermore,
org.springframework.http.HttpHeaders.add(String, String) declares the
headerValue parameter as @Nullable.

This commit therefore updates MockHttpServletResponse to silently
ignore null header values passed to setHeader() and addHeader().

Closes gh-26488
2021-02-02 11:18:34 +01:00
fengyuanwei c82a445094 Fix Javadoc in StandardServletAsyncWebRequest 2021-02-01 08:27:40 +00:00
Rossen Stoyanchev 0ff50d6d9e Improve Javadoc of ServerHttpRequest#getPath
Closes gh-26469
2021-01-29 20:40:13 +00:00
Rossen Stoyanchev ecf5113e0e Handle forwarded header parse issues
Closes gh-26459
2021-01-28 20:45:26 +00:00
Gediminas Rimša 80c4e6bb95 Fix ContentCachingResponseWrapper comment typo 2021-01-28 17:53:38 +00:00
Rossen Stoyanchev 5e5d8e4a23 Handle flushingFailed() for Servlet containers
Closes gh-26434
2021-01-28 17:03:35 +00:00
Sam Brannen c5284009a1 Fix UriComponentsBuilder examples in ref docs
Closes gh-26453
2021-01-27 15:16:15 +01:00
Rossen Stoyanchev e80a23d6ad Fix CheckStyle violations 2021-01-26 17:51:52 +00:00
Rossen Stoyanchev 8aeae49f40 Support for servletPath prefix in ServletRequestPathUtils
Closes gh-26445
2021-01-26 17:30:16 +00:00
Rossen Stoyanchev f22e2ac578 Add HttpServletMapping support to MockHttpServletRequest
See gh-26428
2021-01-26 17:30:16 +00:00
Rossen Stoyanchev bad8954e65 Append unique number to log prefix for Undertow
Closes gh-26430
2021-01-22 15:26:48 +00:00
Rossen Stoyanchev aa7584d252 Support for Jetty 10
Closes gh-26123
2021-01-21 20:16:21 +00:00
Arjen Poutsma e537844a09 Copy headers from part in MultipartBodyBuilder
This commit makes sure that Part.headers() is copied over when adding a
part in the MultipartBodyBuilder.

Closes gh-26410
2021-01-21 16:24:59 +01:00
izeye 469eb8146e Add a missing space in exception message
Closes gh-26385
2021-01-14 12:01:04 +00:00
Rossen Stoyanchev a7413ea76b Add recommendation for original multipart filename
See gh-26299
2021-01-12 17:28:44 +00:00
Sébastien Deleuze 2d53570f4c Prevent kotlinx.serialization usage on interfaces
Remove support for open polymorphic serialization in
kotlinx.serialization web converters and codecs in order
to prevent serialization handling suitable for Jackson
or other general purpose Java JSON libraries.

This will probably need further refinements for collections
for example, and could ultimately be fixed when
kotlinx.serialization will provide a dedicated function to
evaluate upfront if a type can be serialized or not.

Closes gh-26298
2021-01-11 19:07:59 +01:00
Juergen Hoeller be5eb7037f Explicit notes on non-null enforcement and deep cause support in 5.3
Closes gh-26296
See gh-26317
2021-01-11 19:04:12 +01:00
Sam Brannen 2fd6e6e87c Polish Javadoc for base ExceptionHandlerMethodResolvers 2021-01-11 12:58:19 +01:00
Sam Brannen 570bdbd253 Avoid unnecessary sorting in base ExceptionHandlerMethodResolvers 2021-01-11 12:58:19 +01:00
Brian Clozel e4dc863ad0 Fix headers keySet in WebFlux adapters
Prior to this commit, WebFlux native headers adapters would delegate the
`httpHeaders.keySet` to underlying implementations that do not honor the
`remove*` methods.

This commit fixes the `Set` implementation backing the
`httpHeaders.keySet` and ensures that headers can be safely removed from
the set.

Fixes gh-26361
2021-01-11 09:18:10 +01:00
Rossen Stoyanchev 689b5566bf Cache "no match" result from ExceptionHandler methods
Closes gh-26339
2021-01-08 19:25:11 +00:00