Commit Graph

2549 Commits

Author SHA1 Message Date
Sam Brannen 02be21d0dc Polishing 2019-03-02 14:22:28 +01:00
Johnny Lim e21d94f91b Polish
Closes gh-22472
2019-02-26 08:57:03 +01:00
Juergen Hoeller 5c2f3079fd Sync between MockHttpServletResponse copies
See gh-22466
2019-02-25 23:14:37 +01:00
Juergen Hoeller bc0317af3b Merge branch '5.1.x' 2019-02-25 17:57:49 +01:00
Juergen Hoeller 9eb7f7e294 Polishing 2019-02-25 17:36:37 +01:00
Johnny Lim 625e210676 Polish 2019-02-25 12:17:53 +01:00
Sebastien Deleuze dc8fb8bc5e Use StringJoiner where possible to simplify String joining 2019-02-25 12:11:57 +01:00
Brian Clozel afbe7b31bb Polish
See gh-22341
2019-02-11 10:46:27 +01:00
Brian Clozel fb4a28f904 Polish
See gh-22340
2019-02-11 10:45:50 +01:00
Sebastien Deleuze 0b9522c84e Migrate Kotlin Mockito tests to Mockk
Closes gh-22345
2019-02-05 15:47:08 +01:00
Brian Clozel 1bf3b36ce8 Polish
See gh-22340
2019-02-05 15:06:33 +01:00
Brian Clozel ba8849dda3 Avoid MimeType garbage creation
Prior to this commit, calls to `MimeType` and `MediaType` would create a
significant amount of garbage:

* during startup time, in the static sections of `MimeType` and
`MediaType` when creating well-known types
* at runtime, when parsing media types for content negotiation or
writing known media types as strings in HTTP response headers

This commit does the following:

* Avoid parsing the well-known types and use regular constructors
instead
* Cache types in a simple LRU cache once they've been parsed, since an
application is likely to deal with a limited set of types
* Avoid using `java.util.stream.Stream` in hot code paths

Benchmarks show that a complete revision of the `MimeTypeUtils` parser
is not required, since the LRU cache is enough there.

Closes gh-22340
2019-02-05 14:33:43 +01:00
Juergen Hoeller 165d2511b9 Upgrade to Apache HttpClient 4.5.7 and Commons FileUpload 1.4
Includes RxJava 2.2.6, Netty 4.1.33, Undertow 2.0.17.
2019-02-05 00:46:07 +01:00
Juergen Hoeller c700ccbc00 Upgrade to Apache HttpClient 4.5.7
Includes Hibernate ORM 5.4.1 for integration tests.
2019-02-05 00:10:40 +01:00
Arjen Poutsma d3b5ba7a36 Add test case for HttpRequest with relative URIs
Test case for #19890
2019-01-28 16:43:46 +01:00
Rossen Stoyanchev b8f7c37cc4 Merge branch '5.1.x' 2019-01-25 17:01:51 -05:00
Rossen Stoyanchev 4560dc2818 Improve empty body check
Fixes gh-22265
2019-01-25 15:48:04 -05:00
Juergen Hoeller 05f1ea8515 Merge branch '5.1.x' 2019-01-25 15:46:01 +01:00
Juergen Hoeller 85ec9b9df2 Avoid Class.getPackage() in favor of plain Class.getName() checks
Fixes #22306
2019-01-25 15:35:49 +01:00
Marten Deinum 6bdf2c2685 Upgrade to Commons-Fileupload 1.4 2019-01-24 17:53:22 +01:00
Juergen Hoeller 160ecdf956 Merge branch '5.1.x' 2019-01-24 15:35:28 +01:00
Juergen Hoeller 7cc700435b HandlerMethod skips interface parameter introspection for return value
Fixes #22303
2019-01-24 15:18:55 +01:00
Juergen Hoeller 493e9c1ff0 Consistent upgrade to Rome 1.12 and WebJars Locator 0.36 2019-01-24 15:18:43 +01:00
Arjen Poutsma a5cef3845c Improve message for HttpStatusCodeException with empty status text
This commit improves the message for HttpStatusCodeException so that it
defaults to the HttpStatus reason phrase if a status text is not
provided.

This commit also fixes SimpleClientHttpResponse so that it does not
return null for getStatusText().

Fixed #22162
2019-01-23 11:44:00 +01:00
Rossen Stoyanchev e373b46660 Jackson2JsonDecoder tolerates null literal
Fixes #22042
2019-01-18 18:27:40 -05:00
Rossen Stoyanchev 5dcde9e7d7 Trim decoded SSE data
Fixes #22043
2019-01-18 18:13:58 -05:00
Rossen Stoyanchev a77eee899a Document synchronous use of the WebClient
Fixes #22173
2019-01-18 17:46:16 -05:00
Juergen Hoeller 72dddfbc7b Polishing 2019-01-09 12:26:58 +01:00
Rossen Stoyanchev dc3f953f4b Correction for commit #b219c6c
Issue: SPR-17630
2019-01-08 22:43:42 -05:00
Juergen Hoeller a82f049083 FormHttpMessageConverter officially supports non-String form values
Issue: SPR-17645
2019-01-08 17:11:07 +01:00
Rossen Stoyanchev b219c6ce15 Adjust UriComponentsBuilder#toUriString behavior
Commit #93b7a4 added support for pre-configuring URI variables at the
UriComponentsBuilder level, and also changed toUriString to encode
template and URI variables separately. However this went a bit too far
causing side effects for URLs with curly braces that don't represent
URI variables.

This commit restores the original toUriString behavior which is to
encode template and URI variables sepraately only if URI variables have
been pre-configured.

Issue: SPR-17630
2019-01-08 11:06:33 -05:00
王诗峣 b94e8c4bef Fix ClassCastException in FormHttpMessageConverter
We should not cast MultiValueMap<String, ?> to MultiValueMap<String, String>
2019-01-08 12:19:51 +01:00
Juergen Hoeller d37a18ff03 Upgrade to Hibernate Validator 6.0.14 and Apache Johnzon 1.1.11
Includes OkHttp MockWebServer 3.12.1.
2019-01-08 00:50:44 +01:00
Juergen Hoeller 6e3f974951 HttpHeaders.writableHttpHeaders properly handles HttpHeaders.EMPTY
Issue: SPR-17633
2019-01-08 00:32:27 +01:00
Juergen Hoeller 1faeeaea14 HandlerMethodParameter defensively handles interface annotation arrays
Issue: SPR-17629
2019-01-08 00:32:09 +01:00
Rossen Stoyanchev 673a20cb10 Defensive initialization of AsyncXMLInputFactory
Aalto's InputFactoryImpl already disables loading of external entities
by default (property "javax.xml.stream.isSupportingExternalEntities").
This commit goes further by applying the same defensive measures as we
do elsewhere for XMLInputFactory, which disables DTD completely.
Arguably there is no good reason to enable that by default in WebFlux.
2019-01-07 13:52:46 -05:00
Rossen Stoyanchev 63984800e4 Lenient URI template encoding
URI template encoding ignores mismatched curly braces, treating them as
literal parts instead.

Issue: SPR-17630
2019-01-02 16:36:08 -05:00
Rossen Stoyanchev 4b24bcb799 More accurate checks for presence of MediaType.ALL
Typically a straight up equals as well as Collections#contains
checks for MediaType.ALL is susceptible to the presence of
media type parameters.

This commits adds equalsTypeAndSubtype as well as an
isPresentIn(Collection<MimeType>) methods to MimeType to faciliate
with checks for MediaType.ALL.

Issue: SPR-17550
2019-01-02 14:32:50 -05:00
Juergen Hoeller 8d1de75b60 Upgrade to WebJars Locator 0.36 and OkHttp 3.12.1
Includes JRuby 9.2.5 and Jetty Reactive HttpClient 1.0.2.
2018-12-25 13:22:17 +01:00
Brian Clozel 6361b0cb23 Write CharSequence instances to DataBuffers
Prior to this commit, one could write a `CharSequence` to an existing
`DataBuffer` instance by turning it into a byte array or `ByteBuffer`
first. This had the following disadvantages:

1. Memory allocation was not efficient (not leveraging pooled memory
when available)
2. Dealing with `CharsetEncoder` is not always easy
3. `DataBuffer` implementations, like `NettyDataBuffer` can use
optimized implementations in some cases

This commit adds a new `DataBuffer#write(CharSequence, Charset)` method
for those cases and also an `ensureCapacity` method useful for checking
that the current buffer has enough capacity to write to it..

Issue: SPR-17558
2018-12-20 21:33:33 +01:00
Arjen Poutsma 5e4a8966ee Make TomcatHttpHandlerAdapter aware of request/response wrappers
This commit makes TomcatServerHttpRequest aware of
HttpServletRequestWrappers, and TomcatServerHttpResponse aware of
HttpServletResponseWrappers.

Issue: SPR-17611
2018-12-19 12:16:14 +01:00
Violeta Georgieva 09da10cc6c Propagate the cancel signal to the downstream
Issue: SPR-17609
2018-12-18 15:04:08 -05:00
Juergen Hoeller 0e8ed5931d Revised backport version 5.0.11
Issue: SPR-17410
Issue: SPR-17433
2018-12-17 18:19:21 +01:00
Juergen Hoeller a240cfcf2f Consistent support for if-(un)modified-since as ZonedDateTime/Instant
Includes DefaultRequestBodyUriSpec pre-resolving URI for HttpRequest.

Issue: SPR-17571
2018-12-17 16:21:39 +01:00
igor-suhorukov 93189a6733 String.indexOf() expressions can be replaced with a call to the String.contains() method available in Java 5 and newer. 2018-12-13 12:29:31 +01:00
Rossen Stoyanchev 38ae282c3b Update log category precision for all tests
Replace the full category capped at 36 chars with the class name only
and 1 char per package, e.g. org.apache.commons.Foo -> o.a.c.Foo
2018-12-12 11:40:33 -05:00
Rossen Stoyanchev 05d616240a StringHttpMessageConverter defaults to UTF-8 for JSON
Issue: SPR-17568
2018-12-12 11:40:33 -05:00
Rossen Stoyanchev 8eef97da33 HTTP header adapters print header values
Issue: SPR-17546
2018-12-12 11:40:33 -05:00
Juergen Hoeller 7b7a8196f5 Revised HttpHeaders javadoc 2018-12-12 13:20:58 +01:00
Juergen Hoeller 6eb0a60df9 Polishing 2018-12-12 11:16:53 +01:00