Commit Graph

13338 Commits

Author SHA1 Message Date
Brian Clozel
ea5ff87f8e Fix NumberFormatException with X-Forwarded-Host
This commit fixes `NumberFormatException`s that were thrown when parsing
IPv6 host values in `X-Forwarded-Host` request headers.

Issue: SPR-14761
2016-10-07 23:11:34 +02:00
Brian Clozel
53441f8962 Configure default SSL context in Netty RequestFactory
This commit configures a default SslContext if none has been provided.
This also enforces separate Netty bootstrap instances for cleartext and
TLS exchanges.

Issue: SPR-14744
2016-10-06 15:57:26 +02:00
Stephane Nicoll
715006d5df Fix table layout 2016-10-06 15:26:26 +02:00
Sebastien Deleuze
0ba7ea5f92 Upgrade to Reactor Netty 0.5.2.RELEASE
This new Reactor Netty release fix a critical issue that could
prevent proper connection handling.
2016-10-06 15:16:25 +02:00
Juergen Hoeller
ebed7b77c3 SpringValidatorAdapter declares ResolvableAttribute as serializable
Issue: SPR-14778
2016-10-05 21:54:56 +02:00
Juergen Hoeller
ffc781b163 Explicit calls on Buffer base type (for compatibility with covariant return type on JDK 9's ByteBuffer)
Issue: SPR-14645
2016-10-05 00:10:06 +02:00
Juergen Hoeller
2fea1f7da3 Upgrade to RxJava 2.0 RC3 (as well as EhCache 3.1.3 and Hibernate ORM 5.2.3) 2016-10-05 00:04:51 +02:00
Juergen Hoeller
cfa0f6c84b Consistent final logger fields 2016-10-04 23:00:36 +02:00
Juergen Hoeller
684d6ab553 @Lookup reference documentation
Issue: SPR-14765
2016-10-04 22:39:08 +02:00
Sebastien Deleuze
324c310cbd Log unresolved exceptions at error level 2016-10-04 16:08:59 +02:00
Brian Clozel
11aa920785 Remove RxJava 1.x variants of WebClient adapters
Issue: SPR-14743
2016-10-04 14:47:55 +02:00
Brian Clozel
ee17f56626 Fix missing ETag/LastModified headers in responses
Prior to this commit, the `HttpEntityMethodProcessor` would avoid
writing ETag/Last-Modified response headers before calling
`ServletWebRequest` to process conditional requests. This was done to
avoid duplicate response header values due to headers being already
written to the underlying servlet response.

This is still necessary for GET/HEAD requests, since this is properly
handled by `ServletWebRequest` for those cases. But
`HttpEntityMethodProcessor` should not make that decision for
PUT/PATCH/POST responses since developers are adding response headers on
purpose and should be in control of the situation — whereas
`ServletWebRequest` does not write those headers in those cases.

Issue: SPR-14767
2016-10-04 12:08:09 +02:00
Sam Brannen
487bc7505b Print request body in PrintingResultHandler in Spring MVC Test
Prior to this commit, the PrintingResultHandler used by the various
print() and log() methods in Spring MVC Test printed the response body
but not the request body.

Since request bodies are sometimes generated programmatically, however,
it can be beneficial to have the dynamically generated request body
logged as well.

This commit therefore prints the request body in PrintingResultHandler
by delegating to the recently introduced getContentAsString() method in
MockHttpServletRequest.

Issue: SPR-14717
2016-10-03 18:05:58 +02:00
Sam Brannen
04b8ae921e Introduce getContentAsByteArray()/getContentAsString() in MockHtttpSvltReq
In order to improve debugging and logging within test suites, this
commit introduces getContentAsByteArray() and getContentAsString()
methods in MockHttpServletRequest, analogous to the existing methods in
MockHttpServletResponse.

Issue: SPR-14717
2016-10-03 18:05:58 +02:00
Sebastien Deleuze
dbc86ec043 Refine Jackson canEncode() / canDecode() implementation
This commit refine Jackson canEncode() / canDecode()
implementation by using ObjectMapper canSerialize() /
canDeserialize() methods.

Issue: SPR-14748
2016-09-27 23:59:44 +02:00
Sebastien Deleuze
b91c0b3a1a Fix JSON and SSE writer registration
Issue: SPR-14748
2016-09-27 21:56:21 +02:00
Sebastien Deleuze
44ceecc8b3 Imply text/event-stream when serializing ServerSentEvent
Issue: SPR-14748
2016-09-27 09:27:33 +02:00
Juergen Hoeller
fb7ae010c8 Avoid unnecessary generics on emptyMap/Set/List 2016-09-26 18:04:49 +02:00
Juergen Hoeller
a6b0b6e279 Efficient STOMP content-length header check
Issue: SPR-14747
2016-09-26 17:25:21 +02:00
Juergen Hoeller
c64f39943f Polishing 2016-09-26 17:20:30 +02:00
Juergen Hoeller
36f7c7a13e Clarified that getResource never returns null 2016-09-26 15:27:01 +02:00
Juergen Hoeller
bb7d20762c DefaultPersistenceUnitManager extracts jar file from default persistence unit root URL
Issue: SPR-14749
2016-09-26 15:15:45 +02:00
Juergen Hoeller
74c618892e YamlPropertiesFactoryBean consistently exposes String values
Issue: SPR-14737
2016-09-25 21:05:40 +02:00
Juergen Hoeller
e188b4428e Polishing 2016-09-25 21:00:07 +02:00
Juergen Hoeller
94753b5e87 Merge pull request #1185 from dreis2211/stomp-encoder-improvement
Improve performance of StompEncoder

Issue: SPR-14747
2016-09-25 20:42:47 +02:00
Christoph Dreis
774e4c3dc1 Improve performance of StompEncoder
Fixes SPR-14747
2016-09-25 19:09:01 +02:00
Juergen Hoeller
099350a28e Upgrade to Jetty 9.4.0.RC0 and POI 3.15 2016-09-22 13:34:09 +02:00
Josh Long
9b87ea017b fix spelling of word 'recommendation'
this PR fixes the spelling error for the word 'recommendation'
2016-09-21 15:03:04 -04:00
Juergen Hoeller
89717e1783 Reactive setup refinements 2016-09-21 11:24:20 +02:00
Brian Clozel
578af59f0c Polish byte-range resource handling 2016-09-20 23:46:21 +02:00
Juergen Hoeller
129d7bef6e Polishing 2016-09-20 22:41:20 +02:00
Juergen Hoeller
d94ce0a1b2 Avoid package dependency cycles 2016-09-20 22:41:11 +02:00
Juergen Hoeller
65e01eabf0 DispatcherHandler.toWebHandler/toHttpHandler convenience methods 2016-09-20 22:40:43 +02:00
Brian Clozel
5b33e02fb4 Add ClientHttpRequestInterceptor in WebClient
This commit adds a new chain-based, interception contract to be used
with `WebClient`. This is the HTTP client equivalent of the `WebFilter`
contract already implemented in web reactive server.

A `ClientHttpRequestInterceptor` implementation can transform the
outgoing HTTP request (method, URI or headers) before delegating it to
the next interceptor in the chain, or bypass the request processing
altogether and return a (cached) HTTP response.

Issue: SPR-14502
2016-09-20 18:15:07 +02:00
Brian Clozel
c608103140 Add client HTTP request and response Mocks 2016-09-20 18:15:07 +02:00
Sebastien Deleuze
f918a2b192 Rename beforeRead/Write() to resolveRead/WriteHints()
This commit also removes the ServerHttpResponse parameter, not
needed here since it is possible to override the write() method.

Issue: SPR-14557
2016-09-20 17:52:31 +02:00
Brian Clozel
e3da8b5e9c Polish ResourceHttpRequestHandler, ResourceEncoder 2016-09-20 16:49:14 +02:00
Brian Clozel
3596e72050 Add range requests support in ResourceWebHandler
This commit handles range requests in `ResourceWebHandler`, using the
`ResourceHttpMessageWriter` configured within the handler.

This `WebHandler` will add a `HTTP_RANGE_REQUEST_HINT` writer hint
containing all the HTTP Range information of the request.

Issue: SPR-14664
2016-09-20 16:46:03 +02:00
Brian Clozel
a7a9e36ca0 Add ResourceRegionHttpMessageWriter
This new `HttpMessageWriter` leverages the `ResourceRegionEncoder` to
write `ResourceRegion` to HTTP responses, thus supporting HTTP Range
requests.

Whenever possible, this message writer uses the zero copy support for
single range requests.

This `HttpMessageWriter` is never used directly, but is used as a
delegate by the `ResourceHttpMessageWriter`. When provided with the
`BOUNDARY_STRING_HINT`, the `ResourceRegionHttpMessageWriter`
adapts its behavior in order to write a single/multiple byte ranges.

Issue: SPR-14664
2016-09-20 16:18:45 +02:00
Brian Clozel
55d6f88dcd Add ResourceRegionEncoder
This commit adds the necessary infrastructure for the support of HTTP
Range requests. The new `ResourceRegionEncoder` can write
`ResourceRegion` objects as streams of bytes.

The `ResourceRegionEncoder` relies on an encoding hint
`BOUNDARY_STRING_HINT`. If present, the encoder infers that multiple
`ResourceRegion`s should be encoded and that the provided boundary
String should be used to separate ranges by mime boundaries.
If that hint is absent, only a single resource region is encoded.

Issue: SPR-14664
2016-09-20 16:14:22 +02:00
Sebastien Deleuze
1d46b8d7e1 Polish 2016-09-20 14:28:12 +02:00
Sebastien Deleuze
857e77eec2 Make ServerHttpMessageReader/Writer more powerful and flexible
This commit makes it possible, in addition to provide hints, to
perform additional operations with the request and the response
at ServerHttpMessageReader/Writer level.

AbstractServerHttpMessageReader/Writer now provide
convenient beforeRead/beforeWrite abstract methods for such need.

Issue: SPR-14557
2016-09-20 11:55:51 +02:00
Sebastien Deleuze
38f3d12e45 Do not provide hints for can*() methods anymore
Issue: SPR-14557
2016-09-20 11:55:51 +02:00
Arjen Poutsma
b83a6daf4b Javadoc 2016-09-20 11:19:40 +02:00
Rossen Stoyanchev
adc69097fa Fix startup exception related to ResourceWebHandler
Issue: SPR-14735
2016-09-19 21:15:42 -04:00
Juergen Hoeller
d71f6fe366 Latest dependency updates (EclipseLink 2.6.4, Jackson 2.8.3, JavaMail 1.5.6) 2016-09-19 21:51:34 +02:00
Sebastien Deleuze
1bf828a149 Polish 2016-09-19 16:32:50 +02:00
Rossen Stoyanchev
99c7917124 Reset connection before delegating to handler
Resetting the connection first before invoking a failure callback on
the application handler ensures that any checks to isConnected will
return false.

Issue: SPR-14721
2016-09-19 09:04:23 -04:00
Stephane Nicoll
d8a771356c Merge pull request #1180 from kosmaty:doc-formatting-fix
* pr/1180:
  Polish
  Documentation formatting fix
2016-09-19 14:58:15 +02:00
Stephane Nicoll
ec865d27d8 Polish 2016-09-19 14:58:00 +02:00