Commit Graph

3005 Commits

Author SHA1 Message Date
Arjen Poutsma
a7a88371e7 Allow for decode method to return null in AbstractJackson2Decoder
Prior to this commit, the decoder did not allow for a null value
returned from the Jackson object reader.

Closes: gh-23935
2019-11-11 16:48:30 +01:00
Juergen Hoeller
6d47e1e0a1 Fix getHeaderPredicate visibility to be declared as protected
Closes gh-23976
2019-11-11 15:55:06 +01:00
Rossen Stoyanchev
ffe69a51e1 Javadoc update for content negotiation
Closes gh-23409
2019-11-11 12:04:28 +00:00
Tomo Suzuki
21d390a018 Replacing netty-all with specific dependencies 2019-11-08 13:00:37 +00:00
Rossen Stoyanchev
1261e64465 Minor refactoring
Apply default Accept header for HttpUrlConnection only.

See gh-23855
2019-11-08 08:44:04 +00:00
Lorenzo Torracchi
afae8c3045 Avoid default "Accept" from HttpUrlConnection
Closes gh-23740
2019-11-08 08:43:25 +00:00
Arjen Poutsma
55f3f128c9 Polishing 2019-11-07 14:29:47 +01:00
Arjen Poutsma
bf36f49dc5 Corrupt multipart should not hang SynchronossPartHttpMessageReader
This commit notifies the Synchronoss listener that the buffer stream
has ended.

Closes gh-23768
2019-11-07 09:10:07 +01:00
Rossen Stoyanchev
3a241b546f Relax domain name checks in ResponseCookie
Closes gh-23924
2019-11-06 17:54:39 +00:00
Sam Brannen
29599a93a4 Re-enable support for invalid Expires attributes in MockCookie
Changes introduced in commit 9b2087618b
caused a regression for Cookie support in MockHttpServletResponse.
Specifically, an Expires attribute that cannot be parsed using
`ZonedDateTime.parse()` now results in an exception; whereas,
previously an entry such as `Expires=0` was allowed.

This commit fixes this issue in MockCookie by catching and ignoring any
DateTimeException thrown while attempting to parse an Expires attribute.

Closes gh-23911
2019-11-06 18:28:28 +01:00
Sam Brannen
92228f0fc0 Test status quo for @RequestHeader UUID conversion support
See gh-23939
2019-11-06 13:49:44 +01:00
AlexeyAnufriev
2d208de145 Clear connection pool for OkHttpClient
Closes gh-23628
2019-11-01 11:44:16 +00:00
Rossen Stoyanchev
fd9678833f Use int for maxParts instead of long 2019-10-31 14:13:44 +00:00
Brian Clozel
3b724c72b6 Polish
See gh-23884
2019-10-30 19:57:17 +01:00
Sam Brannen
9f00eb68e9 Clean up warnings 2019-10-30 19:14:58 +01:00
Sam Brannen
cef4478b7b Treat InvalidPathException like an IOException in MockServletContext
Prior to this commit, if MockServletContext was configured with a
FileSystemResourceLoader, invocations of the following methods on a
Microsoft Windows operating system resulted in an InvalidPathException
if the supplied path contained a colon (such as "C:\\temp"). This is
inconsistent with the behavior on non-Windows operating systems. In
addition, for comparable errors resulting in an IOException, those
methods (except getRealPath()) return null instead of throwing the
exception.

- getResourcePaths()
- getResource()
- getResourceAsStream()
- getRealPath()

This commit makes handling of InvalidPathException and IOException
consistent for these methods: both exceptions now result in null be
returned by these methods.

Closes gh-23717
2019-10-30 15:59:44 +01:00
Juergen Hoeller
19ff7d84ab Polishing 2019-10-30 14:31:46 +01:00
Juergen Hoeller
19107649d2 Revise concurrent JAXBContext creation towards computeIfAbsent
Closes gh-23879
2019-10-30 14:31:34 +01:00
Rossen Stoyanchev
422c26832b Minor follow-up to previous commit
See gh-23741
2019-10-30 12:38:26 +00:00
Rossen Stoyanchev
34cfbe5d26 ResponseStatusException associated headers
A ResponseStatus exception now exposes extra method to return headers
for the response. This is used in ResponseStatusExceptionHandler to
apply the headers to the response.

Closes gh-23741
2019-10-30 12:10:45 +00:00
Juergen Hoeller
046380988b Nullability refinements 2019-10-30 00:26:11 +01:00
Rossen Stoyanchev
5abf24e7d7 Expose maxInMemorySize via CodecConfigurer
Centralized maxInMemorySize exposed via CodecConfigurer along with
ability to plug in an instance of MultipartHttpMessageWrite.

Closes gh-23884
2019-10-29 12:33:16 +00:00
Rossen Stoyanchev
00ead7a756 Refine multipart parsing limits
See gh-23884
2019-10-29 12:33:16 +00:00
Brian Clozel
ea6f51e9e3 Configurable limits with Synchronoss
See gh-23884
2019-10-29 12:33:16 +00:00
Brian Clozel
69bcdfc17f Polishing 2019-10-29 12:33:16 +00:00
Rossen Stoyanchev
89d053d7f4 Limits on input stream in codecs
- Add maxInMemorySize property to Decoder and HttpMessageReader
  implementations that aggregate input to trigger
  DataBufferLimitException when reached.

- For codecs that call DataBufferUtils#join, there is now an overloaded
  variant with a maxInMemorySize extra argument. Internally, a custom
  LimitedDataBufferList is used to count and enforce the limit.

- Jackson2Tokenizer and XmlEventDecoder support those limits per
  streamed JSON object.

See gh-23884
2019-10-29 12:33:16 +00:00
Sam Brannen
ce0b012f43 Polish contribution
See gh-23769
2019-10-29 13:27:39 +01:00
Vedran Pavic
9b2087618b Preserve expires attribute in MockCookie
At present, MockCookie doesn't preserve expires attribute. This has a
consequence that a cookie value set using
MockHttpServletResponse#addHeader containing an expires attribute will
not match the cookie value obtained from
MockHttpServletResponse#getHeader, since the expires attribute will get
calculated based on current time.

This commit enhances MockCookie to preserve the expires attribute.

Closes gh-23769
2019-10-29 12:56:24 +01:00
Rossen Stoyanchev
780eef8d36 Update comment in HttpWebHandlerAdapter
See gh-23780
2019-10-23 17:31:59 +01:00
Johnny Lim
33bf09d513 Polish HttpWebHandlerAdapter.handleUnresolvedError() 2019-10-23 16:57:20 +01:00
Rossen Stoyanchev
2733511ea2 Charset argument in RestClientResponseException
See gh-23764
2019-10-23 16:49:32 +01:00
Rossen Stoyanchev
4932196b87 RestClientResponseException defaults to UTF-8
Closes gh-23764
2019-10-23 16:26:57 +01:00
Sam Brannen
112bbe859c Fix grammar in Javadoc 2019-10-22 18:07:41 +02:00
Brian Clozel
a65c6f6884 Fix APPLICATION_PROBLEM_JSON_UTF8 media type value
This commit adds the missing "+json" suffix to the "application/problem"
media type for its deprecated UTF-8 variant.

Fixes gh-23825
2019-10-17 09:36:05 +02:00
Sam Brannen
972337e8f9 Introduce common .gitattributes file
Closes gh-23376
2019-10-02 15:22:39 +02:00
Juergen Hoeller
2861fc65bd Polishing 2019-09-27 10:17:56 +02:00
Sam Brannen
f05b4625de Merge branch '5.1.x' 2019-09-26 10:55:55 +02:00
Sam Brannen
7d126d3288 Improve documentation regarding "annotated classes"
See gh-23638
2019-09-26 10:26:36 +02:00
Juergen Hoeller
3616e96792 Upgrade to SLF4J 1.7.28, Groovy 2.5.8, RxJava 2.2.12, Joda-Time 2.10.4, Rome 1.12.2, OkHttp 3.14.3, Apache HttpClient 4.5.10, Apache Johnzon 1.1.13 2019-09-25 22:27:41 +02:00
Rossen Stoyanchev
2995b6f224 Merge branch '5.1.x' 2019-09-25 17:28:24 +01:00
Rossen Stoyanchev
17c423f5af Support for sameSite attribute in WebFlux
Bypass server cookie and write Set-Cookie header directly for Reactor
Netty, and Servlet API which do not provide options.

For Undertow use the sameSite attribute.

Closes gh-23693
2019-09-25 17:16:48 +01:00
Rossen Stoyanchev
30e1257dda Merge branch '5.1.x' 2019-09-24 13:39:42 +01:00
Sam Brannen
402046f3c7 Polish data buffer allocation tests 2019-09-24 14:24:36 +02:00
Rossen Stoyanchev
4edc7196fb Refine disconnected client handling in WebFlux
If an error looks like a "disconnected client" but the response is not
yet committed then it can't be an I/O error from writing to the server
response. It is most likely as a result of a remote call as part of
request handling.

Not setting the response to 500 in this case results in a 200 response
status despite the error. Even if it was an I/O error from the server
response, setting the status won't impact a failed response.

Closes gh-23319
2019-09-24 11:09:42 +01:00
Sam Brannen
2572cd0503 Make PathPatternParserTests compatible with JDK 13
Closes gh-23669
2019-09-21 17:33:28 +02:00
Brian Clozel
4cfcc108fe Merge branch '5.1.x' 2019-09-17 09:49:47 +02:00
Brian Clozel
ca2b2f5533 Wait for complete disposal of Reactor Netty resources
Fixes gh-23631
2019-09-17 09:49:05 +02:00
Phillip Webb
d945ae9191 Add blank line between java and javax imports
See gh-23539

Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2019-09-16 13:41:59 +02:00
Sam Brannen
bd28bb1f56 Add additional tests for HttpHeaders.keySet() operations
See gh-22821
2019-09-16 12:36:05 +02:00
Phillip Webb
aa69703f3b Fix LinkedCaseInsensitiveMap collection methods
Ensure that results returned from keySet, entrySet & values are tracked
to remove case insensitive keys from the source map.

Closes gh-22821
2019-09-16 12:36:05 +02:00