Commit Graph

1201 Commits

Author SHA1 Message Date
Sebastien Deleuze
0d8fbb4c65 Merge branch '5.1.x' 2019-03-21 11:34:10 +01:00
Sebastien Deleuze
35010149f8 Fix Jackson builder modulesToInstall override behavior
This commit updates Jackson2ObjectMapperBuilder in order
to ensure that modules specified via modulesToInstall
eventually override the default ones.

Closes gh-22576
2019-03-21 11:24:03 +01:00
Rossen Stoyanchev
4938831575 Register custom before default codecs
Closes gh-22612
2019-03-20 20:52:57 -04:00
Rossen Stoyanchev
4a397f108a ResourceDecoder supports filename hint
Closes gh-22267
2019-03-19 17:50:06 -04:00
Rossen Stoyanchev
5a3ff35215 Map arg resolver backs out if annotations present
Closes gh-21874
2019-03-19 16:41:26 -04:00
Rossen Stoyanchev
57a67a3c06 Header predicate option in AbstractRequestLoggingFilter
Closes gh-22244
2019-03-12 17:05:40 -04:00
Rossen Stoyanchev
2b4cd5cf56 Fragment should be expanded last
Closes gh-22447
2019-03-12 15:10:35 -04:00
Lars Grefer
a98e3f0481 Migrate CacheControl to use java.time.Duration for durations 2019-03-08 09:12:19 +01:00
Juergen Hoeller
18f2e6a12d AnnotationConfigRegistry exposes registerBean with supplier/qualifiers
Closes gh-22457
2019-03-05 18:26:04 +01:00
Juergen Hoeller
b2b0df893a Merge branch '5.1.x' 2019-03-05 14:20:02 +01:00
Juergen Hoeller
013c0bca92 Polishing 2019-03-05 13:08:11 +01:00
Juergen Hoeller
f6693e790a Jackson2Tokenizer passes DeserializationContext into TokenBuffer
Closes gh-22510
2019-03-05 13:08:04 +01:00
Rossen Stoyanchev
e3e1ffc986 Encoder/Decoder based payload serialization
See gh-21987
2019-03-04 23:35:43 -05:00
Sam Brannen
02be21d0dc Polishing 2019-03-02 14:22:28 +01:00
Juergen Hoeller
5c2f3079fd Sync between MockHttpServletResponse copies
See gh-22466
2019-02-25 23:14:37 +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
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
dc3f953f4b Correction for commit #b219c6c
Issue: SPR-17630
2019-01-08 22:43:42 -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
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
Juergen Hoeller
5bbbc82e19 Consistent handling of null header values in HttpHeaders
Issue: SPR-17588
2018-12-12 11:16:45 +01:00
Juergen Hoeller
9efea7eb73 MockHttpServletRequest preserves original Accept-Language header value
Issue: SPR-17566
2018-12-04 22:07:43 +01:00
Sebastien Deleuze
91de8d265e Fix ProtobufDecoder handling of split message size
This commit introduces a new readMessageSize(DataBuffer input) private
method, inspired from CodedInputStream#readRawVarint32(int, InputStream)
and adapted for DataBuffer using MessageDecoderFunction fields in
order to support use cases where the message size is split between
distinct chunks.

It also fixes handling of end of streams by using
DataBuffer#readableByteCount instead of -1 which is only relevant with
InputStream.

Issue: SPR-17429
2018-11-23 14:22:58 +01:00
Juergen Hoeller
77ab88b144 Polishing 2018-11-23 13:56:02 +01:00
Juergen Hoeller
738097def2 DefaultResponseErrorHandler detects non-standard error code as well
Issue: SPR-17439
2018-11-23 13:55:50 +01:00
Rossen Stoyanchev
7e9857a663 ForwardedHeaderTransformer handles encoding correctly
Issue: SPR-17525
2018-11-21 10:54:39 -05:00
Arjen Poutsma
f3c29fe2e6 Add test for UriUtils.encode(String, Charset)
Issue: SPR-17451
2018-11-20 10:51:19 +01:00
Rossen Stoyanchev
abf9ce8a34 Improve handling of empty response with Mono<T>
Issue: SPR-17560
2018-11-19 16:48:38 -05:00
Brian Clozel
3203d39821 Remove Content-Length response header from errors
Prior to this commit, when errors happened before the response was
committed, the `Content-Length` response header would be left as is.
This can be problematic since the error can be handled later in the
chain and the response body changed accordingly. For example, Spring
Boot renders error pages in those cases. If the `Content-Length` is set,
HTTP clients can get confused and only consider part of the error
response body.

This commit ensures that any `Content-Length` response header is removed
in case of errors, if the response is not already committed.

This is done at the `AbstractServerHttpResponse` level, since errors can
be handled in multiple places and the response itself is the safest
place to handle this case.

As a consequence, this commit also removes `Content-Length` checks in
`EncoderHttpMessageWriter` since we now consider that we should rely on
the response body we're about to write rather than any previously set
value.

Issue: SPR-17502
2018-11-19 15:49:54 +01:00
Stephane Nicoll
7b6f2f8fb3 Polish contribution
Closes gh-2019
2018-11-19 08:45:33 +01:00
Hanope
bfb49c7249 Fix typos
See gh-2019
2018-11-19 08:41:21 +01:00
Arjen Poutsma
539cfc24c6 Refactor AbstractEncoderTestCase
Refactor AbstractEncoderTestCase to resemble AbstractDecoderTestCase

Issue: SPR-17449
2018-11-16 14:33:26 +01:00
Arjen Poutsma
39ce989d1a Add and use AbstractDecoderTestCase
Introduce new base test case for decoder tests, and use it.

Issue: SPR-17449
2018-11-16 14:33:26 +01:00
Rossen Stoyanchev
46a5fb7a91 Configurable Marshaller/Unmarshaller in JAXB2 codecs
Issue: SPR-17388
2018-11-13 16:56:56 -05:00
Arjen Poutsma
3bab3515b1 Add and use AbstractEncoderTestCase
Introduce new base test case for encoder tests, and use it.

Issue: SPR-17449
2018-11-13 13:35:37 +01:00
Rossen Stoyanchev
e4c84ec757 Consistent default encoding in DefaultUriBuilderFactory
Issue: SPR-17465
2018-11-09 14:13:51 -05:00
Rossen Stoyanchev
ed1d63dcc3 ResolvableMethod copy in spring-messaging src/test 2018-11-08 13:29:21 -05:00
Juergen Hoeller
e71ff2901a Polishing 2018-11-05 22:59:33 +01:00
Juergen Hoeller
5e7a8b275d Polishing 2018-11-05 19:33:24 +01:00
Rossen Stoyanchev
48654c6483 Polish 2018-11-01 14:21:00 -04:00
Rossen Stoyanchev
7c36549e3a Consistent InvocableHandlerMethod implementations
This commit makes the 3 existing InvocableHandlerMethod types more
consistent and comparable with each other.

1. Use of consistent method names and method order.

2. Consistent error formatting.

3. Explicit for loops for resolving argument values in webflux variant
because that makes it more readable, creates less garabage, and it's
the only way to bring consistency since the other two variants cannot
throw exceptions inside Optional lambdas (vs webflux variant which can
wrap it in a Mono).

4. Use package private HandlerMethodArgumentComposite in webflux
variant in order to pick up the resolver argument caching that the
other two variants have.

5. Polish tests.

6. Add missing tests for messaging variant.
2018-10-30 16:36:01 -04:00
Arjen Poutsma
95542778ad Fix MultipartHttpMessageWriterTests
Issue: SPR-17419
2018-10-25 12:13:03 +02:00
Arjen Poutsma
7a8a2d9608 Fix HttpMessageWriter tests
Issue: SPR-17419
2018-10-25 12:13:03 +02:00
Arjen Poutsma
256a6fe6cb Fix memory leak for ServerSentEventHttpMessageWriter
This commit fixes a memory leak in ServerSentEventHttpMessageWriter
that occurs when the input stream contains an error. Test added as well.

Issue: SPR-17419
2018-10-25 12:13:03 +02:00
Juergen Hoeller
ffa032e78f Polishing 2018-10-24 20:46:26 +02:00
Juergen Hoeller
f0f1979fc5 Support for @RequestParam Map declared with MultipartFile/Part values
Issue: SPR-17405
2018-10-24 20:44:58 +02:00
Arjen Poutsma
611019b73c Fix memory leak for Jaxb2XmlEncoder
This commit fixes a memory leak in Jaxb2XmlEncoder that occurs when
the input stream contains an error. Test added as well.

Issue: SPR-17419
2018-10-24 16:28:21 +02:00