Commit Graph

2633 Commits

Author SHA1 Message Date
Rossen Stoyanchev
dd22b8fd39 Fix race condition with onCompletion/onError
Closes gh-23096
2019-08-27 21:43:33 +03:00
Sam Brannen
8189c90741 Allow Set-Cookie header to be overwritten in MockHttpServletResponse
Prior to this commit, there was no way to replace the Set-Cookie header
via MockHttpServletResponse. Specifically, an invocation of setHeader()
for the Set-Cookie header resulted in an additional Set-Cookie header
instead of replacing the existing one, which is in violation of the
contract for javax.servlet.http.HttpServletResponse.setHeader(...).

This commit refactors the internals of MockHttpServletResponse to ensure
that an existing Set-Cookie header is overwritten when set via an
invocation of setHeader(). This commit also verifies the expected
behavior for addHeader() and addCookie() with regard to multiple cookies.

Closes gh-23512
2019-08-27 17:20:38 +02:00
Rossen Stoyanchev
a7bb5ca473 Remove unnecessary iteration over headers
The use of LinkedCaseInsensitiveMap, going back to 3.0, makes it
unnecessary to iterate over keys which can cause
ConcurrentModificationException.

Closes gh-23460
2019-08-21 13:34:17 +03:00
Rossen Stoyanchev
b86c11cc9b Respect existing content-length for HTTP HEAD
Closes gh-23484
2019-08-21 02:28:19 +03:00
Juergen Hoeller
ea4f7d365f Deprecate logger field in HandlerMethodArgumentResolverComposite 2019-07-31 23:48:21 +02:00
Juergen Hoeller
59064f0780 Upgrade to Undertow 2.0.23 and Apache Johnzon 1.1.12 2019-07-30 22:27:09 +02:00
Juergen Hoeller
960079e5f5 Retain non-null HttpStatus return value in Client(Http)Response
See gh-23366
2019-07-30 22:26:46 +02:00
Arjen Poutsma
29ef985411 Add support for non-standard status codes
Added support for status codes that do not occur in HttpStatus in
DefaultClientResponseBuilder and made ClientResponse::statusCode
ClientHttpResponse::getStatusCode @Nullable.

Closed gh-23366
2019-07-30 17:44:47 +02:00
Juergen Hoeller
c4622dbebc Polishing 2019-07-30 16:59:01 +02:00
Rossen Stoyanchev
7b697266be PathPatternParser allows '-' in variables
The isJavaIdentifier check is not really required, but also seems
intuitive for variables to be Java identifier-like. This commit relaxes
the constraint a bit by also allowing "-".

Closes gh-23101
2019-07-30 12:04:47 +01:00
Sam Brannen
5034d1e7b3 Introduce ServerHttpRequest.Builder.header() variant for setting headers
Prior to this commit, the `header(String, String)` method in the
ServerHttpRequest.Builder API actually added a header value instead of
setting or overriding a header value. Since this conflicted with the
stated behavior in the Javadoc as well as the original intention of the
method, we have decided to introduce an overloaded variant
`header(String, String...)` which accepts a var-args list of header
values to set or override.

In addition, this commit deprecates the existing `header(String, String)`
method for removal in Spring Framework 5.2.

In order not to be a breaking change for custom implementations of the
builder API, this commit implements the new `header(String, String...)`
method as an interface `default` method, with the intent to remove the
default implementation in Spring Framework 5.2

closes gh-23333
2019-07-25 13:02:09 +02:00
Johnny Lim
946fc39d42 Add Javadoc since for Jaxb2XmlDecoder(MimeType...)
See gh-23353
2019-07-25 08:38:46 +02:00
Juergen Hoeller
92890232df Upgrade to OpenPDF 1.2.21, Rome 1.12.1, XStream 1.4.11.1
Includes updated javadoc links for 5.1.x branch.
2019-07-20 18:20:03 +02:00
Rossen Stoyanchev
153ac82380 Polish 2019-07-19 10:44:23 +01:00
Andreas Kluth
4973e110ee An empty X-Forwarded-Prefix with a path containing escape sequences leads to exceptions. 2019-07-19 10:44:23 +01:00
Rossen Stoyanchev
2b94205ba9 Update docs on multipart with RestTemplate
Replace docs on using MultipartBodyBuilder for the RestTemplate with
examples that show MultiValueMap. Originally the idea was to make
MultipartBodyBuilder accessible to the RestTemplate too, but with
support for async parts that's no longer a good fit.

Closes gh-23295
2019-07-19 10:43:50 +01:00
Rossen Stoyanchev
99c4a9eeba Filtering for nested ERROR dispatch
OncePerRequestFilter now has a doFilter method that allows separate
processing of nested ERROR dispatches. This is useful for filters
that wrap the request and response.

Closes gh-23196
2019-07-15 11:23:12 +01:00
Rossen Stoyanchev
235858e4e5 Exposes supported mime types in Jaxb2Decoder
Closes gh-23278
2019-07-13 11:00:43 +01:00
桂坤
81eb911c09 Fix typo in UrlPathHelper
See gh-23274
2019-07-11 09:54:03 +02:00
Sam Brannen
efab6eb55d Ignore empty entries when parsing MediaTypes and MimeTypes
Prior to Spring Framework 5.1.3, MimeTypeUtils.parseMimeTypes() and
MediaType.parseMediaTypes() ignored empty entries, but 5.1.3 introduced
a regression in that an empty entry -- for example, due to a trailing
comma in the list of media types in an HTTP Accept header -- would result
in a "406 Not Acceptable" response status.

This commit fixes this by filtering out empty entries before parsing
them into MimeType and MediaType instances. Empty entries are therefore
effectively ignored.

Fixes gh-23241
2019-07-07 12:39:46 +02:00
Rossen Stoyanchev
594c5806a6 Handle error in apply of writeFunction
Closes gh-23175
2019-06-21 14:15:14 +01:00
Sam Brannen
ad915f4a26 Document that Ordered is not supported for @ControllerAdvice beans
Closes gh-23172
2019-06-21 12:39:34 +03:00
Sebastien Deleuze
bcad276adb Fix Jackson documentation broken links
Closes gh-23153
2019-06-19 13:59:36 +02:00
Sam Brannen
d18d4d865e Update Javadoc for HtmlUtils regarding Apache Commons Text
Closes gh-23122
2019-06-14 14:48:24 +03:00
Juergen Hoeller
fc46abf0b7 Polishing 2019-06-12 18:04:06 +02:00
Juergen Hoeller
627d37f73b Thread-safe removal of destruction callbacks in web scopes
Closes gh-23117
2019-06-12 14:11:13 +02:00
Juergen Hoeller
4877736794 Polishing 2019-06-12 00:58:04 +02:00
Juergen Hoeller
22aba8bf60 Upgrade to Apache HttpClient 4.5.9 2019-06-11 23:49:57 +02:00
Juergen Hoeller
7dc92aa05d Polishing 2019-06-11 20:57:27 +02:00
Juergen Hoeller
1956cb1e57 Defensive concurrent access to shared file extension data structures
Closes gh-23064
2019-06-11 20:57:17 +02:00
Rossen Stoyanchev
9f8148419f Separate "filtered" attribute for ERROR dispatch
Closes gh-22989
2019-06-07 16:07:56 -04:00
Ilya Lukyanovich
2ed81be831 Fix MockHttpServletRequest.setCookies to produce single cookie header
Prior to this commit, MockHttpServletRequest.setCookies() produced one
Cookie header per supplied cookie, resulting in multiple Cookie headers
which violates the specification.

This commit fixes this by ensuring that all cookie name-value pairs are
stored under a single Cookie header, separated by a semicolon.

Closes gh-23074
2019-06-06 17:13:21 +03:00
Rossen Stoyanchev
49e5c4dcf6 Polish MultipartBodyBuilder
Improve Javadoc
Consistently reject Publisher unless using asyncPart
Consistently set Content-Type when specified
2019-06-04 16:41:10 -04:00
Rossen Stoyanchev
4f05da7fed Support escape character in ContentDisposition
Closes gh-23077
2019-06-03 16:03:35 -04:00
Sebastien Deleuze
4523d01a50 Fix Javadoc for HttpHeaders#setContentLanguage
Closes gh-23051
2019-05-29 11:53:38 +02:00
Juergen Hoeller
5aa0de7ac8 Upgrade to OkHttp 3.14.2, Joda-Time 2.10.2, OpenPDF 1.2.17, JRuby 9.2.7 2019-05-21 20:47:06 +02:00
Juergen Hoeller
8cd3daad0d Polishing 2019-05-21 00:15:40 +02:00
Juergen Hoeller
75d751d968 Polishing 2019-05-20 22:19:11 +02:00
Juergen Hoeller
4c334de850 Use Map.values() iteration within isMultipart check
Closes gh-22982
2019-05-20 17:17:51 +02:00
Rossen Stoyanchev
ffd7cffa14 Fix typo in HttpHeaders
Closes gh-22976
2019-05-15 16:42:07 -04:00
Rossen Stoyanchev
0274752fe9 Use singleOrEmpty to avoid upstream cancel
Closes gh-22952
2019-05-15 16:02:28 -04:00
Sebastien Deleuze
c8d49ed284 Fix EncoderHttpMessageWriter.isStreamingMediaType()
Closes gh-22936
2019-05-09 14:57:15 +02:00
Sam Brannen
59fdce1116 Fix bug in EncoderHttpMessageWriter.isStreamingMediaType() 2019-05-09 13:24:27 +02:00
Juergen Hoeller
190b751147 Support any HttpEntity implementing ResolvableTypeProvider
Closes gh-22931
2019-05-09 02:09:31 +02:00
Rossen Stoyanchev
6e0dfd6999 Check if Accept-Charset is present before adding it
Closes gh-22506
2019-05-08 09:40:32 -04:00
Arjen Poutsma
cdd346222c Add reference counting for UndertowDataBuffer
This commit adds proper reference counting to the UndertowDataBuffer.
2019-05-08 11:58:48 +02:00
Juergen Hoeller
053b95ceeb Refer to non-deprecated Jackson 2.5+ addMixIn method in javadoc 2019-05-07 02:06:40 +02:00
Juergen Hoeller
c841b62bb0 Consistent parameter retrieval across InvocableHandlerMethod variants
See gh-22900
2019-05-07 01:20:05 +02:00
Juergen Hoeller
3f85a7db1b Consistent exception naming across InvocableHandlerMethod variants
See gh-22900
2019-05-07 00:48:27 +02:00
Sebastien Deleuze
4b31feb243 Clarify Jackson2ObjectMapper.modules(ToInstall) semantics
Closes gh-22747
2019-05-06 22:09:56 +02:00