Commit Graph

3121 Commits

Author SHA1 Message Date
Sam Brannen 17140c8d4b Polish contribution
See gh-24595
2020-03-17 17:15:12 +01:00
Andrew Woodbury 2fb13d410d Include response body in UnknownHttpStatusCodeException
Spring Framework 5.2.2 introduced a regression in
DefaultResponseErrorHandler.handleError(ClientHttpResponse)
Specifically, for use cases where the InputStream had already been
consumed by the first invocation of getResponseBody(), the second
invocation of getResponseBody() resulted in the response body being
absent in the created UnknownHttpStatusCodeException.

This commit fixes this by invoking getResponseBody() only once in
DefaultResponseErrorHandler.handleError(ClientHttpReponse) in order to
reuse the retrieved response body for creating the exception message
and as a separate argument to the UnknownHttpStatusCodeException
constructor.

Closes gh-24595
2020-03-17 17:06:57 +01:00
Sam Brannen a8feb792da Fix broken Javadoc links 2020-03-16 16:30:27 +01:00
Rossen Stoyanchev a599859595 ServerCookie ignores empty domain with double quotes
Closes gh-24663
2020-03-12 12:21:19 +00:00
Juergen Hoeller 6df80a8f70 Restore original JsonMappingException handling (assuming invalid input)
Closes gh-24610
Closes gh-24630
Closes gh-24646
2020-03-11 14:51:36 +01:00
Rossen Stoyanchev a98bf30ee6 ShallowEtagHeaderFilter checks for pre-existing eTag
The filter now checks for an explicitly set eTag and uses it instead of
generating one, and also suppresses caching.

Closes gh-24635
2020-03-04 19:17:56 +00:00
Rossen Stoyanchev d3da7a50ec Polishing and minor refactoring
See gh-24635
2020-03-04 19:17:56 +00:00
Rossen Stoyanchev 2afae430eb Update list of support multipart media types
See gh-24582
2020-03-03 15:38:00 +00:00
Johnny Lim 8285666ee8
Polish ReactorResourceFactory
Closes gh-24620
2020-03-02 13:48:19 +01:00
Adrian Cole 7f5395a216
Fix typos in AbstractClientHttpRequest
Closes gh-24623
2020-03-02 13:36:47 +01:00
ZhangT c5fb7b9fb7
Simplify some redundant code
Closes gh-24586

Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2020-02-26 12:29:09 +01:00
Juergen Hoeller d72c90cd7a Assign TokenBuffer field with createToken() result 2020-02-25 15:21:28 +01:00
Rossen Stoyanchev b6f502db4e Polishing 2020-02-25 10:07:29 +00:00
Brian Clozel f1680e5cee Configure quiet period for shutting down Reactor resources
This commit adds two new properties to the `ReactorResourceFactory`.
This allows to configure the quiet and timeout periods when shutting
down Reactor resources. While we'll retain Reactor Netty's default for
production use, this option is useful for tests and developement
environments when developers want to avoid long waiting times when
shutting down resources.

Fixes gh-24538
2020-02-24 18:15:59 +01:00
Rossen Stoyanchev de608a08ed Polishing contribution
See gh-24518
2020-02-20 15:56:13 +00:00
Robert Gründler ae9268004d Added debug logging to DefaultWebSessionManager
See gh-24518
2020-02-20 15:55:59 +00:00
Arjen Poutsma 4882eb278d Convert non-UTF-8 JSON
Jackson's asynchronous parser does not support any encoding except UTF-8
(or ASCII). This commit converts non-UTF-8/ASCII encoded JSON to UTF-8.

Closes gh-24489
2020-02-20 11:14:53 +01:00
Sam Brannen e029dbf607 Polish Javadoc for ClientHttpResponse 2020-02-19 11:46:03 +01:00
Hyunjin Choi 37ba57a921
Polish some test classes by using predefined constants
Closes gh-24532
2020-02-18 12:24:10 +01:00
Juergen Hoeller a4179b4795 Polishing 2020-02-12 18:32:32 +01:00
Juergen Hoeller 9f6572a095 Add missing final declaration for static field 2020-02-12 16:49:19 +01:00
Juergen Hoeller b889700548 Differentiate MismatchedInputException versus ValueInstantiationException
Closes gh-24455
2020-02-12 16:48:32 +01:00
Rossen Stoyanchev 9277b47040 Polishing: remove use of cast where avoidable 2020-02-11 16:51:35 +00:00
Rossen Stoyanchev e35d3b8bb5 Update advice on RestTemplate
Closes gh-24503
2020-02-11 14:02:50 +00:00
Rossen Stoyanchev 28a95e89f3 Upgrade to Dysprosium SR5 snapshots
See gh-24355
2020-02-11 12:52:04 +00:00
Rossen Stoyanchev df706f4c7c Restore use of Flux-based encode method in HTTP
Closes gh-24441
2020-02-07 21:44:44 +00:00
Arjen Poutsma a03a116f6b Force TokenBuffer to use BigDecimal if elementtype
This commit makes the Jackson2Tokenizer enable
TokenBuffer.forceUseOfBigDecimal if the element type given to the
Decoder is BigDecimal. Previous to this commit, values would be
converted to floats.

Closes gh-24479
2020-02-07 14:16:21 +01:00
Arjen Poutsma 45555f77a6 Honour ObjectMapper feature in Jackson2Tokenizer
After this commit, Jackson2Tokenizer honours ObjectMapper's
DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS feature when creating
TokenBuffers.

Closes gh-24479
2020-02-07 10:45:00 +01:00
Rossen Stoyanchev ba5fc21ab4 Option to pair AnnotationIntrospector instances
Closes gh-22830
2020-02-05 20:49:07 +00:00
Rossen Stoyanchev f5df422de9 Polishing contribution
See gh-24470
2020-02-03 20:32:36 +00:00
Hyunjin Choi 273812f9c5 Remove unnecessary escapes in regular expressions
See gh-24470
2020-02-03 20:22:40 +00:00
Rossen Stoyanchev 547342b27d Status code as Integer methods in ServerHttpResponse
Closes gh-24400
2020-01-30 10:06:58 +00:00
Rossen Stoyanchev cc4261c30b Only non-null input resets scheme specific part
Closes gh-24444
2020-01-30 06:16:43 +00:00
Rossen Stoyanchev 2fcee5ae58 Append unique number to WebFlux server log prefix
Closes gh-22039
2020-01-24 15:57:56 +00:00
Rossen Stoyanchev d499e14b78 Update default value in ReactorResourceFactory
We used ConnectionProvider#elastic only to customize the name. Now that
Reactor Netty's TcpResources itself uses fixed 500 by default, we
update to have the same value which would apply when global resources
are not used.

Closes gh-24424
2020-01-24 15:40:16 +00:00
Rossen Stoyanchev b142f8e660 Remove no-op code in URI encoding
Closes gh-24413
2020-01-24 15:37:01 +00:00
Johnny Lim 5a0b768a3d Fix typo in Javadoc 2020-01-23 15:52:46 +00:00
Rossen Stoyanchev 992e75303d Improve support for generics in Jackson codecs
Closes gh-23791
2020-01-23 12:31:00 +00:00
Rossen Stoyanchev c69703ffdb Deprecate path extension strategies
This commit deprecates PathExtensionContentNegotiationStrategy and
ServletPathExtensionContentNegotiationStrategy and also updates code
that depends on them internally to remove that dependence.

See gh-24179
2020-01-22 13:35:09 +00:00
Rossen Stoyanchev 542e187831 Expose media type mappings in ContentNegotiationManager
ContentNegotiationManagerFactoryBean now ensures that
ContentNegotiationManager contains the MediaType mappings even if the
path extension and the parameter strategies are off.

There are also minor fixes to ensure the media type mappings in
ContentNegotiationManagerFactoryBean aren't polluted when mapping keys
are not lowercase, and likewise MappingMediaTypeFileExtensionResolver
filters out duplicates in the list of all file extensions.

See gh-24179
2020-01-22 13:35:09 +00:00
Rossen Stoyanchev 214ba63127 Deprecate config options for content negotiation by path extension
See gh-24179
2020-01-22 13:35:09 +00:00
Arjen Poutsma 54669c51c9 Use Jackson SequenceWriter for streaming
Before this commit, the AbstractJackson2Encoder instantiated a
ObjectWriter per value. This is not an issue for single values or
non-streaming scenarios (which effectively are the same, because in the
latter values are collected into a list until offered to Jackson).
However, this does create a problem for SMILE, because it allows for
shared references that do not match up when writing each value with a
new ObjectWriter, resulting in errors parsing the result.

This commit uses Jackson's SequenceWriter for streaming scenarios,
allowing Jackson to reuse the same context for writing multiple values,
fixing the issue described above.

Closes gh-24198
2020-01-21 14:22:00 +01:00
Rossen Stoyanchev 5e9d29d813 Ability to customize default Smile codecs
Closes gh-24382
2020-01-20 17:29:59 +00:00
Rossen Stoyanchev 5d8c5b0d9b Avoid NPE on comment SSE event
Closes gh-24389
2020-01-20 11:26:58 +00:00
Brian Clozel 59bef22235 Avoid setting special Content-* response headers for Tomcat
As of gh-21783, Spring WebFlux uses a `TomcatHeadersAdapter`
implementation to directly address the native headers used by the
server.

In the case of Tomcat, "Content-Length" and "Content-Type" headers are
processed separately and should not be added to the native headers map.

This commit improves the `HandlerAdapter` implementation for Tomcat and
removes those headers, if previously set in the map. The adapter
already has a section that handles the Tomcat-specific calls for such
headers.

Fixes gh-24361
2020-01-17 15:01:58 +01:00
Rossen Stoyanchev ac8eaca475 HttpWebHandlerAdapter#formatRequest is protected
Closes gh-24352
2020-01-16 14:54:29 +00:00
Sam Brannen 1c270d8d06 Fix Checkstyle violation 2020-01-13 18:21:36 +01:00
Rossen Stoyanchev 29fe65d23c Upgrade to Dysprosium snapshots
See gh-24349
2020-01-13 16:49:42 +00:00
Rossen Stoyanchev cbc57460b7 Support for maxInMemorySize in SSE reader
Closes gh-24312
2020-01-13 14:57:14 +00:00
Sébastien Deleuze bc7d010485 Update CORS support
This commit updates CORS support in order to check Origin header
in CorsUtils#isPreFlightRequest which does not change how Spring
MVC or WebFlux process CORS request but is more correct in term
of behavior since it is a public API potentially used in another
contexts.

It also removes an unnecessary check in
AbstractHandlerMethodMapping#hasCorsConfigurationSource and processes
every preflight request with PreFlightHandler.

Closes gh-24327
2020-01-13 08:33:14 +01:00