Commit Graph

2371 Commits

Author SHA1 Message Date
Brian Clozel 69e3fde295 Avoid duplicate Accept header values in RestTemplate
Prior to this commit, the various `HttpMessageConverter` instances
configured for a given `RestTemplate` instance could all contribute
`MediaType` values to the "Accept:" request header.

This could lead to duplicate media types in that request header,
cluttering for the HTTP request for no reason.

This commit ensures that only distinct values are added to the request.

Issue: SPR-16690
2018-04-12 22:28:31 +02:00
Rossen Stoyanchev 224589ea74 Remove write pausing in Undertow response
Using the simple example shown in the ticket but switching from
Mono<String> to Flux<String> (and 5,000,000 onNext calls) shows that
constant pausing causes significant overhead and is not worth the
trouble vs ignoring the onWritePossible in REQUESTED state.

Issue: SPR-16702
2018-04-11 14:27:27 -04:00
Rossen Stoyanchev 3549745e37 Avoid inifinite recursion in UndertowServerHttpResponse
Undertow does not provide a way to check if we can write so with the
current implementation of isWritePossible, deep recursion can occur
when writing slows down. We now use a flag to keep track of write
ChannelListener callbacks.

This commit also addresses a related issue in
AbstractListenerWriteProcessor that went undected since #3c2d186
where after a large (single) buffer that is not written fully, the
completion signal is processed before the all data is written.

Issue: SPR-16702
2018-04-11 14:27:27 -04:00
sdeleuze 89d069b09d Add default ctor to Reactive UrlBasedCorsConfigurationSource
Issue: SPR-16712
2018-04-11 14:38:42 +02:00
sdeleuze 27e87e5593 Document why "charset=UTF-8" is specified for JSON
Issue: SPR-14715
2018-04-09 12:03:17 +02:00
Brian Clozel 2dde000475 Document socket timeout config limitations for HttpClient
This commit documents the difference between configuring the socket
timeout on the `RequestConfig` and on the `SocketConfig`.

The first one does not affect timeouts when establishing an SSL
connection or sending a CONNECT request to a proxy. For these use cases,
it is required to configure `SocketConfig` on the `HttpClient` instance
directly.

Issue: SPR-16697
2018-04-06 16:35:17 +02:00
Juergen Hoeller 66a3a82fb3 Avoid reference to HandlerMethod class in ServerErrorException
This breaks the package dependency cycle between web.server/web.method and makes ServerErrorException more generally applicable. Includes deprecation of the plain reason constructor variant, in favor of providing a Method or MethodParameter context (which MatrixVariableMethodArgumentResolver does now).
2018-04-01 00:21:15 +02:00
Juergen Hoeller 28ea718d2d Build setup allows for JDK 10 as source/test target compatibility
Includes upgrade to Groovy 2.4.15 and HtmlUnit 2.30.

Issue: SPR-16390
2018-03-31 23:17:31 +02:00
Rossen Stoyanchev d9e17a62ce Refine SyncInvocableHandlerMethod error handling
Ensure the error is wrapped as ServerErrorException
2018-03-31 12:06:24 -04:00
Juergen Hoeller 912c270f2b Polishing 2018-03-31 17:49:21 +02:00
Rossen Stoyanchev 4454ffd2b1 Replace remaining use of block operator 2018-03-31 11:18:38 -04:00
Stephane Maldini b8d32095a9 workaround multipart integration test using blocking receive inside netty thread 2018-03-30 15:43:11 -07:00
Juergen Hoeller 0bc01fcd55 Polishing 2018-03-30 13:42:23 +02:00
Rossen Stoyanchev 240d6f52c9 Replaces rather than prepend contextPath
Issue: SPR-16650
2018-03-29 18:17:29 -04:00
Juergen Hoeller d553ddc5b3 Nullability refinements (based on IntelliJ IDEA 2018.1 introspection)
Issue: SPR-15756
2018-03-29 23:50:17 +02:00
igor-suhorukov 93abe0e94b All branches in a conditional structure should not have exactly the same implementation 2018-03-29 23:33:50 +02:00
Rossen Stoyanchev dd96c873e3 Improve docs on forwarded headers
Issue: SPR-16660
2018-03-29 16:11:01 -04:00
Rossen Stoyanchev a546cf0a3b Reject invalid forwarded headers
Issue: SPR-16660
2018-03-29 15:28:34 -04:00
Juergen Hoeller b165475eb6 Polishing 2018-03-29 16:05:52 +02:00
Rossen Stoyanchev f9e6ea5482 MvcResult returns asyncResult after asyncDispatch
Issue: SPR-16648
2018-03-28 22:15:16 -04:00
Juergen Hoeller d95bbb6b1b Test for hasError keeping body available in case of unknown status code
Issue: SPR-16604
2018-03-28 12:16:03 +02:00
Juergen Hoeller b2d87abcbb Polishing 2018-03-28 12:06:38 +02:00
Rossen Stoyanchev 5861e9685b Always specify charset for form data requests
Issue: SPR-16613
2018-03-27 19:56:09 -04:00
igor-suhorukov 4aae6a6dda Use Map.forEach instead of manual Map.Entry iteration wherever possible SPR-16646 2018-03-28 01:09:03 +02:00
Rossen Stoyanchev f3994467c4 Refine ContentNegotiationStrategy contract
Consistently return "*/*" if no media types were requested rather than
an empty list. Existing code has to check for both in any case to see
if nothing was requested.

Issue: SPR-16624
2018-03-27 16:54:19 -04:00
Juergen Hoeller e3d0ef6015 Use Map.forEach instead of manual Map.Entry iteration wherever possible
Issue: SPR-16646
2018-03-27 00:38:32 +02:00
Juergen Hoeller 10cb2ccaef Avoid triggering lazy resolution in MultipartResolver.cleanupMultipart
Issue: SPR-16640
2018-03-27 00:25:05 +02:00
Rossen Stoyanchev a989ea0867 Polish Synchronoss message reader
Issue: SPR-16639
2018-03-24 08:59:16 -04:00
Rossen Stoyanchev 0af847c01c ServerSentEventHttpMessageReader internal refactoring
Eliminate use of .block() which Reactor now flags as illegal on
schedulers where that's not expected.
2018-03-23 19:01:11 -04:00
Juergen Hoeller ba5ef6456f WebFluxResponseStatusExceptionHandler for @ResponseStatus introspection
The web.server package is quite low-level and should not depend on web.bind in order to avoid a dependency cycle. Extracting the introspection of the ResponseStatus annotation into a WebFlux-level subclass resolves the cycle.

Issue: SPR-16567
2018-03-21 16:12:32 +01:00
Rossen Stoyanchev f9df8c738a Avoid inifinite recursion in UndertowServerHttpRequest
Undertow does not provide a way to check if data is available to read
but instead we have to try to read and see if any data is returned.
This makes it impossible to implement checkOnDataAvailable without
trying to read and that can lead to infinite recursion like this:

...
UndertowServerHttpRequest$RequestBodyPublisher.checkOnDataAvailable(UndertowServerHttpRequest.java:156)
AbstractListenerReadPublisher.changeToDemandState(AbstractListenerReadPublisher.java:177)
AbstractListenerReadPublisher.access$900(AbstractListenerReadPublisher.java:47)
AbstractListenerReadPublisher$State$4.onDataAvailable(AbstractListenerReadPublisher.java:319)
AbstractListenerReadPublisher.onDataAvailable(AbstractListenerReadPublisher.java:85)
UndertowServerHttpRequest$RequestBodyPublisher.checkOnDataAvailable(UndertowServerHttpRequest.java:156)

This commit prevent the call to checkOnDataAvailable() when switching
states from READING->DEMAND which implies we exited the readAndPublish
loop because there was no more data to read.

Issue: SPR-16545
2018-03-20 17:21:33 -04:00
Juergen Hoeller 442ddb0845 Correct documentation of default HttpMessageConverters in RestTemplate
Issue: SPR-7885
2018-03-19 20:38:14 +01:00
Rossen Stoyanchev 26bb3a0893 Improve docs on enabling Servlet 3 multipart 2018-03-19 11:20:08 -04:00
Rossen Stoyanchev 8651b8d4c1 Show use of RequestEntity rather than HttpEntity
Issue: SPR-16608
2018-03-19 08:57:01 -04:00
Rossen Stoyanchev 30583a62cf Fix Class isAssignableFrom checks for Resource conversion
Issue: SPR-16606
2018-03-16 16:18:05 -04:00
Rossen Stoyanchev 842c29103f MultipartBodyBuilder supports PublisherEntity as input
Issue: SPR-16601
2018-03-16 16:18:05 -04:00
Rossen Stoyanchev 313c6cef32 Polish 2018-03-16 16:18:05 -04:00
Juergen Hoeller f8588e364a AcceptHeaderLocaleResolver keeps language match among supported locales
Issue: SPR-16599
2018-03-16 14:17:50 +01:00
Rossen Stoyanchev 7de2650a70 Drop @WebServlet annotation
Issue: SPR-16591
2018-03-16 00:14:54 -04:00
Rossen Stoyanchev 72bbb2619d Commit actions are (properly) deferred
Issue: SPR-16597
2018-03-15 23:17:57 -04:00
Juergen Hoeller 2096676b3f Upgrade to Apache Johnzon 1.1.7 and JRuby 9.1.16 2018-03-15 15:43:45 +01:00
Juergen Hoeller d4a8f76bf9 Consistent volatile access to running flag in Lifecycle implementations
Issue: SPR-16488
2018-03-15 15:17:55 +01:00
Rossen Stoyanchev b8d94f8a20 Improve WebFlux support for response status exceptions
Support @ResponseStatus annotated exceptions.
Supported root cause exceptions with response status information.

Issue: SPR-16567
2018-03-14 20:07:00 -04:00
Juergen Hoeller 58011f71e9 Consistent assertions for template method result vs servlet registration 2018-03-14 18:55:50 +01:00
Juergen Hoeller 41730220f4 InterceptingClientHttpRequest adapts to StreamingHttpOutputMessage
Issue: SPR-16582
2018-03-12 22:31:48 +01:00
sdeleuze 36a222acd5 Take into account the MimeType's charset in Jackson encoder
Notice that per specification, only Unicode is supported
(UTF8, UTF16_BE, UTF16_LE, UTF32_BE, UTF32_LE).

Issue: SPR-16539
2018-03-12 21:54:53 +01:00
Juergen Hoeller cf74b1b8be Consistent result synchronization in WebAsyncManager
Issue: SPR-16571
2018-03-09 09:03:15 +01:00
igor-suhorukov 58a5138f26 simplify lambda expression 2018-03-08 23:44:32 +01:00
igor-suhorukov d89f9af22d parentheses should be removed from a single lambda input parameter when its type is inferred 2018-03-08 21:55:45 +01:00
Juergen Hoeller 139dc1d373 Polishing (collapsed if checks, consistent downcasts, refined javadoc) 2018-03-08 18:11:57 +01:00
igor-suhorukov 0f7485b01d Polish: reorder the modifiers to comply with the Java Language Specification. 2018-03-08 17:57:47 +01:00
Violeta Georgieva 030bc224e3 Invert the check for ServletInputStream.isReady()
When checking whether there is still request body the first method
that should be checked is ServletInputStream.isReady() and then
ServletInputStream.isFinished(). ServletInputStream.isReady() is the active
method whereas the ServletInputStream.isFinished() is not.
It is important to call ServletInputStream.isReady() because if it returns
false it will schedule a dispatch and if the request body is already read it will
send onAllDataRead event.

Issue: SPR-16521
2018-03-07 11:23:10 -05:00
Rossen Stoyanchev 27815847b1 content-length support in EncoderHttpMessageWriter
EncoderHttpMessageWriter checks explicitly for Mono publishers and sets
the content length, if it is known for the given data item.

Issue: SPR-16542
2018-03-06 19:04:02 -05:00
Rossen Stoyanchev 7a8e0ff3c3 Update ServerWebExchangeTests 2018-03-06 18:12:37 -05:00
Juergen Hoeller 90d768bb7f Overloaded convenience setters: setCacheControl(CacheControl), setExpires(ZonedDateTime)
Issue: SPR-16562
2018-03-06 23:06:04 +01:00
Rossen Stoyanchev e48def2d35 Set readyToWrite flag after cached signals emitted
Issue: SPR-16555
2018-03-05 23:23:39 -05:00
Juergen Hoeller c543368aad Polishing 2018-03-03 17:33:48 +01:00
igor-suhorukov 06fef1e5a4 Polish: assertion arguments should be passed in the correct order 2018-03-03 16:14:45 +01:00
Stephane Nicoll 38ebb6c982 Restore includes and isCompatibleWith
See gh-1713
2018-03-03 12:41:58 +01:00
igor-suhorukov 129530f792 Polish
Closes gh-1715
2018-03-03 12:12:15 +01:00
Rossen Stoyanchev cef98e1125 FilePart uses correct flags when opening files
Issue: SPR-16546
2018-03-02 10:42:50 -05:00
igor-suhorukov ed936cbd89 Polish: Overriding methods should do more than simply call the same method in the super class 2018-03-02 00:06:27 +01:00
Juergen Hoeller 478162741d WebApplicationContextFacesELResolver.isReadOnly returns true for WAC
Issue: SPR-16543
2018-03-01 01:32:11 +01:00
igor-suhorukov 8080f56db8 Polish: "@Override" should be used on overriding and implementing methods 2018-03-01 00:15:18 +01:00
Juergen Hoeller 9962df6527 Polishing 2018-02-28 00:09:15 +01:00
igor-suhorukov 7bce04c06c Polish: combine catches block with same body 2018-02-27 12:51:28 +01:00
Rossen Stoyanchev e0e90ed006 SSE writer respects charset in MediaType
Issue: SPR-16516
2018-02-26 16:42:00 -05:00
Juergen Hoeller 15c97b753e Revised URI building in http.server (consistently use raw attributes)
Issue: SPR-16434
2018-02-26 13:00:38 +01:00
Juergen Hoeller 2a379e099c Polishing 2018-02-25 21:24:38 +01:00
Juergen Hoeller 8a56cd0e8b Revised URI building in http.server (avoid package cycle with web.util)
Issue: SPR-16434
2018-02-25 21:24:10 +01:00
igor-suhorukov b202205d77 Polish: String.valueOf() should not be appended to a String 2018-02-25 21:10:19 +01:00
igor-suhorukov 49fd724d8f Polish: String function use should be optimized for single characters 2018-02-25 20:48:47 +01:00
Juergen Hoeller 0ef9568c06 Upgrade to OkHttp 3.10 (as well as RxJava 2.1.10 and Caffeine 2.6.2) 2018-02-25 15:38:56 +01:00
igor-suhorukov c782075a13 Polish: Array designators "[]" should be on the type, not the variable 2018-02-25 13:14:20 +01:00
Juergen Hoeller 3531c104b0 Prefer Collections.addAll call with array over Set.addAll(Arrays.asList) 2018-02-25 00:21:39 +01:00
Juergen Hoeller eeecbaef2c Gson/JsonbHttpMessageConverter keeps output stream open (for SseEmitter)
Issue: SPR-16529
2018-02-23 10:49:38 +01:00
Juergen Hoeller 578c078082 Polishing 2018-02-22 15:14:20 +01:00
Juergen Hoeller 1278459ad5 ReactorHttpHandlerAdapter logs bad request at warn level only
Issue: SPR-16524
2018-02-22 15:12:51 +01:00
Juergen Hoeller 0939492966 Upgrade to Apache Johnzon 1.1.6 2018-02-22 11:32:14 +01:00
Juergen Hoeller a5cbf5fe24 Consistent use of Collection.toArray with zero-sized array argument
Includes consistent use of ClassUtils.toClassArray (as non-null variant)

Issue: SPR-16523
2018-02-22 11:29:46 +01:00
Rossen Stoyanchev 3bfa56dff2 Polish 2018-02-21 10:29:46 -05:00
Rossen Stoyanchev 6959e66b25 JsonEOFException is wrapped as DecodingError
Jackson2Tokenizer now also wraps JsonProcessingException's on
endOfInput(), as it also does in tokenize(DataBuffer). This ensures
treating those errors as 400 vs 500.

Issue: SPR-16521
2018-02-21 10:12:33 -05:00
Rossen Stoyanchev a6d527e57a Call onAllDataRead when read() returns -1
When read returns -1, we know we've reached the end of input. Instead
of waiting for the onAllDataRead container callback, this commit
proactively calls onAllDataRead.

Issue: SPR-16521
2018-02-21 09:44:24 -05:00
Juergen Hoeller 0de36d2883 Consistent HttpMethod identity comparisons 2018-02-18 22:01:22 +01:00
Juergen Hoeller d7cab23e6d Consistent use of StringUtils.toStringArray
(cherry picked from commit 6d11b40)
2018-02-16 20:49:17 +01:00
Rossen Stoyanchev 9c679fccdf Fix intdentation 2018-02-16 12:34:25 -05:00
Rossen Stoyanchev ac495d7380 Polish ForwardedHeaderFilter and related code
Issue: SPR-16506
2018-02-16 12:17:23 -05:00
Rossen Stoyanchev 6920a1f958 ForwardedHeaderFilter handles query+fragment correctly
Issue: SPR-16506
2018-02-16 11:10:50 -05:00
Rossen Stoyanchev dcf5c646be Use correct X509 certificate attribute name
Issue: SPR-16507
2018-02-16 09:45:17 -05:00
Juergen Hoeller 8d3264f680 Prefer List.sort(Comparator) over Collections.sort(List, Comparator) 2018-02-16 10:23:18 +01:00
Rossen Stoyanchev 4db0d999af Polish UriBuilderFactory and implementation
Issue: SPR-16422
2018-02-15 15:44:44 -05:00
Rossen Stoyanchev 3d20db1e49 Polish UriUtils, UriComponents
Issue: SPR-16422
2018-02-15 15:44:37 -05:00
Juergen Hoeller cd8a1bdb8b AcceptHeaderLocaleContextResolver leniently handles invalid header value
Also falls back to language-only match among its supported locales now.

Issue: SPR-16500
Issue: SPR-16457
2018-02-15 13:14:49 +01:00
Juergen Hoeller 7baf33fea0 Avoid multiple warnings related to jackson-module-kotlin
Issue: SPR-16497
2018-02-14 21:19:57 +01:00
Rossen Stoyanchev 1aeae5d40d Fix compiler error 2018-02-14 12:23:52 -05:00
Rossen Stoyanchev 0ead0503eb AbstractJackson2Encoder uses private fields
Make the protected fields in AbstractJackson2Encoder private plus
minor refactoring to the way streaming separators are applied.

The current (5.0.3) behavior is to always use '\n', but in 5.0.4 the
newly supported "application/stream+x-jackson-smile" needs to be
excluded from that. For now, separator determination remains private
in the abstract base class, but current behavior remains which is to
apply '\n' by default.

Issue: SPR-15424
2018-02-14 12:15:01 -05:00
Sam Brannen 24adc7d3c6 Delete unused imports 2018-02-14 16:55:57 +01:00
igor-suhorukov 7826567df6 Polish: lamdbas containing only one statement should not nest this statement in a block 2018-02-14 01:22:01 +01:00
Juergen Hoeller 99662bc702 Polishing 2018-02-13 23:32:10 +01:00
igor-suhorukov 45e520ed86 Polish: remove unused private fields, remove empty operator 2018-02-13 23:00:18 +01:00
Rossen Stoyanchev 8c37ad7ac5 Startup/shutdown log messages for AbstractHttpServer
Issue: SPR-16494
2018-02-13 14:58:10 -05:00
Juergen Hoeller 0c78c9c6f7 Refined javadoc and exception messages 2018-02-13 15:25:42 +01:00
Vladimir Sitnikov 659f13be1c Avoid creating message arguments to Assert.isABC calls
See 67f184293b
2018-02-13 12:31:49 +01:00
Juergen Hoeller a5a069c5b1 Upgrade to JavaMail 1.6.1 2018-02-13 00:02:43 +01:00
igor-suhorukov 0ee505b73e Polish: assertion arguments should be passed in the correct order,
use assertNull instead of assertEquals(null, value),
declare delta as double value in assertEquals
2018-02-10 17:17:28 +01:00
Juergen Hoeller 39201adca4 Consistent handling of InterruptedException
Issue: SPR-16479
2018-02-10 13:03:33 +01:00
igor-suhorukov 6ea0af3540 Polish: Lambdas should be replaced with method references 2018-02-10 12:09:46 +01:00
igor-suhorukov 9a6fbf59c5 Polish: follow name convention - make immutable fields final 2018-02-10 12:09:19 +01:00
Stephane Nicoll 991eb4858e Update copyright header 2018-02-09 10:16:58 +01:00
igor-suhorukov c0b4b5787f Change this "try" to a try-with-resources
Closes gh-1671
2018-02-09 10:12:55 +01:00
igor-suhorukov e381514b07 Collection.isEmpty() should be used to test for emptiness
Closes gh-1670
2018-02-09 10:11:44 +01:00
igor-suhorukov 4c888d0f32 Polish
Closes gh-1669
2018-02-09 10:10:05 +01:00
Arjen Poutsma fb61af1882 Allow "release on close" for DataBuffer.asInputStream
This commit introduces DataBuffer.asInputStream(boolean), that can
release the underlying buffer when the stream is closed.

Furthermore, this commit adds additional javadoc.

Issue: SPR-16444
2018-02-08 10:11:53 +01:00
Rossen Stoyanchev 1b98d09855 Fix copy+paste error 2018-02-06 15:43:05 -05:00
Rossen Stoyanchev efdfe9ad8d Minor Javadoc update 2018-02-06 11:23:53 -05:00
Rossen Stoyanchev 1653a32a04 Stabilize Flux.interval emissions in integration tests
After this commit the use of interval in tests is combined with
take(n).onBackpressureBuffer(n) to ensure emissions don't fail if the
fixed rate is exceeded (e.g. on slow CI server).

Tests that verify N number of items followed by verifyOnComplete()
should set the number of emissions to N.

Tests that verify N number of items followed by thenCancel() should
set the number of buffered to an arbitrary number greater than N.
2018-02-06 11:01:19 -05:00
Juergen Hoeller 5c813a366b Consistent use of @throws instead of @exception 2018-02-05 22:51:51 +01:00
Juergen Hoeller 817a836960 Consistent object type exposure for JSON rendering (workaround for Gson)
Issue: SPR-16461
2018-02-05 22:51:33 +01:00
sdeleuze 196f3f8cc1 Improve WebFlux exception logging
This commit updates HttpWebHandlerAdapter and
ResponseStatusExceptionHandler in order to specify the method/uri in the
logged message.

It also logs a WARN message for bad request (400) HTTP responses in
order to get some logs when an exception is thrown due to client error
(unable to deserialize request body for example).

Issue: SPR-16447
2018-02-05 16:08:22 +01:00
Arjen Poutsma 609f173ebc StringDecoder shouldn't chop off strings randomly
Issue: SPR-16337
2018-02-02 15:59:21 +01:00
Juergen Hoeller c5a33d62dd TypeVariablesVariableResolver compares variables by full equality again
Issue: SPR-16456
2018-02-02 12:41:43 +01:00
Juergen Hoeller b3e21ec737 MockHttpServletRequest leniently handles invalid Accept-Language header
Issue: SPR-16454
2018-02-02 11:34:22 +01:00
Juergen Hoeller 4a1cc9ced7 Constructor-provided field values get recorded for failed binding result
Also, TypeMismatchExceptions get registered via BindingErrorProcessor.

Issue: SPR-16449
2018-02-02 11:33:56 +01:00
Rossen Stoyanchev 6d909b013e Do not commit response on access to content
MockHttpServletResponse no longer calls flushBuffer on calls to
getContentAsByteArray and getContentAsString. The flushing doesn't
actually do anything useful but does commit the response leading to
unexpected side effects.

Issue: SPR-16430
2018-01-30 16:19:08 -05:00
sdeleuze d02e4fb545 Add Vary:Access-Control-Request-Method/Headers CORS headers
This commit adds these 2 Vary headers in addition to the existing
Origin one to avoid caching of Access-Control-Request-Method and
Access-Control-Request-Headers headers which can be an issue
when allowed methods or headers are unbounded and only the
requested method or headers are returned in the response.

Issue: SPR-16413
2018-01-30 17:00:32 +01:00
Rossen Stoyanchev f4de8615aa Fix encoding issue in ServerHttpRequest.mutate()
Issue: SPR-16434
2018-01-30 10:23:02 -05:00
Rossen Stoyanchev 4f28c28287 Update Javadoc on uriTemplateHandler property
Issue: SPR-16419
2018-01-29 21:53:22 -05:00
sdeleuze 32f6ccece8 Add WebFlux support for Smile streaming
The commit brings following changes:
 - Move getDecodableMimeTypes() to AbstractJackson2Decoder
 - Move getEncodableMimeTypes() to AbstractJackson2Encoder
 - Add support for application/stream+x-jackson-smile
 - Avoid streaming line separator when Smile encoder is used
 - Use double null token in Jackson2Tokenizer to identify documents

Issue: SPR-16151
2018-01-29 18:56:25 +01:00
Juergen Hoeller e49198d49f Polishing 2018-01-25 22:12:29 +01:00
Juergen Hoeller ef3f93e84a Language tag parsing support in StringUtils and StringToLocaleConverter
Issue: SPR-16188
2018-01-25 19:10:31 +01:00
Juergen Hoeller c6b0d85a7c Consistent available() support in DelegatingServletInputStream
Issue: SPR-16416
2018-01-25 19:06:20 +01:00
Rossen Stoyanchev b948e7cf75 Polish 2018-01-24 19:58:14 -05:00
Rossen Stoyanchev 84cc7ffdf6 Fix test failure 2018-01-24 19:55:46 -05:00
Juergen Hoeller 0e6f8df0a8 ServletServerHttpRequest.getURI() ignores malformed query string
The resolved URI instance is also being cached now. This should not make a difference in a real Servlet environment but does affect tests which assumed they could modify an HttpServletRequest path behind a pre-created ServletServerHttpRequest instance. Our WebSocket test base class has been revised accordingly, re-creating the ServletServerHttpRequest in such a case.

Issue: SPR-16414
2018-01-24 22:13:40 +01:00
Stephane Nicoll 42a2081e8c Polish "Remove an unnecessary intermediate variable"
Closes gh-1650
2018-01-24 09:18:46 +01:00
Johnny Lim 826db88509 Remove an unnecessary intermediate variable
See gh-1650
2018-01-24 09:18:24 +01:00
Juergen Hoeller 91e6274b7d Upgrade to Apache HttpClient 4.5.5 and Tomcat 8.5.27 2018-01-22 22:11:00 +01:00
Arjen Poutsma b47491695e Support array of scalar values in Jackson2Tokenizer
Issue: SPR-16407
2018-01-22 17:08:08 +01:00
Juergen Hoeller 9d0e62ef68 Javadoc format and related polishing 2018-01-22 11:43:21 +01:00
Arjen Poutsma 0befc60c8f Renamed DataBufferUtils/DataBufferFactory.compose to join
Issue: SPR-16365
2018-01-22 10:51:07 +01:00
Arjen Poutsma 646fcc5c2f Support Custom Headers for Multipart Async Data
This commit makes sure there is no custom Content-Disposition header
before setting one automatically.

This commit also adds a headers(Consumer<HttpHeaders>) method, so that
one can user the nicer methods of HttpHeaders, as opposed to basic
strings.

Issue: SPR-16376
2018-01-20 15:18:20 +01:00
Juergen Hoeller 395c9bd723 Consistently call HttpURLConnection.setFixedLengthStreamingMode(long)
Issue: SPR-16404
2018-01-20 14:29:40 +01:00
andrm 142f1ab42f Removed unnecessary cast to int
Since Java7 HttpURLConnection offers setFixedLengthStreamingMode method with long parameter which should be prefered over version with int argument, therefore casting ContentLength to int is no longer needed. Moreover it makes impossible to stream payload larger than Integer.MAX_VALUE
2018-01-20 14:11:15 +01:00
Rossen Stoyanchev 283811b16b Ensure filename is written
Now that SPR-16307 makes it possible to write a part with a Publisher
we need to ensure we get the filename correctly when writing with
Publisher<Resource>.

Issue: SPR-16376
2018-01-19 22:12:53 -05:00
Rossen Stoyanchev afd248da8a MultipartHttpMessageWriter consumes source once only
The previous fix #09f1f7 did not actually address the issue but only
moved it further down, so instead of the subscribe(), it was consuming
it inside the MultipartHttpMessageWriter#write method which returned
this.body.then(), and then again for the actual request body writing.

In this commit MultipartHttpMessageWriter#write returns Mono.empty()
since we don't actually want to write the part content from there, but
only want to access it as soon as it is availabele, for writing to
the request body.

Issue: SPR-16402
2018-01-19 20:55:22 -05:00
Juergen Hoeller 572c668726 Polishing 2018-01-19 21:30:37 +01:00
Arjen Poutsma 5520e730f1 DataBufferUtils.read should not take input stream/channel as parameter
Fixed by creating `Callable`-based variants, as explained in the JIRA
issue.

Issue: SPR-16403
2018-01-19 17:38:14 +01:00
Rossen Stoyanchev 09f1f727a7 Remove explicit subscribe in MultipartHttpMessageWriter
Issue: SPR-16402
2018-01-19 10:41:08 -05:00
Juergen Hoeller 40127bd9ad Polishing 2018-01-19 12:30:10 +01:00
Juergen Hoeller 9623cdec48 Functional response builders allow for non-standard HTTP status codes
Issue: SPR-16366
2018-01-14 17:45:58 +01:00
Juergen Hoeller 06e6386dc9 CollectionUtils.lastElement for common Set/List extraction
Issue: SPR-16374
2018-01-12 18:23:52 +01:00
Juergen Hoeller 93f645800b Test for non-equality after URI normalization
Issue: SPR-16364
2018-01-12 16:46:06 +01:00
Arjen Poutsma 67e7c784e8 Use DataBufferUtils.compose and remove writeAggregator
Use DataBufferUtils.compose instead of writeAggregator to combine
multiple data buffers into one, as the write aggregator would not work
when the initial data buffer did not have enough capacity to contain
all subsequent buffers.

Removed writeAggregator, as it is no longer needed.

Issue: SPR-16365
2018-01-12 10:36:09 +01:00
Rossen Stoyanchev c60313de3f Refine UriTemplate match pattern
The match/matches methods of UriTemplate use a regex with (.*) in place
of URI variables, which work fine except in the end where such a
pattern can match greedily more than one segment.

This commit updates the regex to use ([^/]*) instead since URI
variables are only meant to be used within a single path segment.

Issue: SPR-16169
2018-01-11 16:36:35 -05:00
Arjen Poutsma 8a129ef3da Use write aggregator from DataBufferUtils
This commit uses the newly introduced write aggregator from
DataBufferUtils throughout WebFlux.

Issue: SPR-16351
2018-01-10 11:15:47 +01:00
Rossen Stoyanchev 5ed0cf9027 Fix init issues in AbstractReactiveWebInitializer
Issue: SPR-16290
2018-01-09 17:32:40 -05:00
Rossen Stoyanchev 018469286d Polish 2018-01-09 16:39:40 -05:00
Jeff Nelson 30e40210a8 Extract protected method in AbstractRequestLoggingFilter
Issue: SPR-16245
2018-01-09 16:38:21 -05:00
sdeleuze 9c7de232b8 Polishing
Optimize same origin check when the request is an instance of
ServletServerHttpRequest and when there is no forwarded headers.

This commit also optimizes the getPort methods and ForwardedHeaderFilter
forwarded headers checks.

Issue: SPR-16262
2018-01-09 14:33:54 +01:00
sdeleuze c326e44488 Refine forwarded protocol support
This commit refines forwarded protocol support in order to support
proxies that only set "X-Forwarded-Proto" header and not
"X-Forwarded-Port" by performing a reset of the port in such case.

"Forwarded" header support has been updated accordingly since it
also supports similar use case, as described in SPR-15504.

Issue: SPR-16262
2018-01-09 14:33:54 +01:00
Rossen Stoyanchev 446e7ed25c Links from @RequestMapping to reference docs
Issue: SPR-16266
2018-01-08 09:29:52 -05:00
Juergen Hoeller 4a57e26d76 Polishing 2018-01-07 23:33:35 +01:00
Rossen Stoyanchev 37f0e8c6e5 Access to ApplicationContext via ServerWebExchange
Issue: SPR-16298
2018-01-05 15:46:45 -05:00
Juergen Hoeller a49123a72b Upgrade to RxJava 2.1.8 (and Protobuf 3.5.1) 2017-12-31 18:51:22 +01:00
sdeleuze d2616b7996 Fix RestOperations extensions parameters nullability
Issue: SPR-16328
2017-12-27 17:54:38 +01:00
sdeleuze deac8e556e Improve Kotlin extensions doc about type erasure
Since type erasure can be fixed only when using
ParameterizedTypeReference based Java methods, RestOperations and
WebFlux API documentation should be updated to specify which extensions
are subject to type erasure, and which are not.

Issue: SPR-16273
2017-12-27 17:49:18 +01:00
Arjen Poutsma 6c3a64578c Move ResolvableType from HttpEntity to PublisherEntity
This commit moves the ResolvableType field from HttpEntity to
PublisherEntity, a new entity type defined in MultipartBodyBuilder.
With this change, the scope of the ResolvableType is limited to
multipart-related code, instead of becoming part of the complete
HttpEntity hierarchy.

Issue: SPR-16307
2017-12-22 13:44:01 +01:00
Arjen Poutsma f23612c3a3 Add ResolvableType to HttpEntity for multipart Publishers
This commit adds a ResolvableType field to HttpEntity, in order to
support Publishers as multipart data. Without the type, the
MultipartHttpMessageWriter does not know which delegate writer to use to
write the part.

Issue: SPR-16307
2017-12-21 17:40:27 +01:00
Juergen Hoeller 4577a19190 Upgrade to Commons Pool 2.5 (and Jackson Kotlin Module 2.9.3) 2017-12-21 13:52:00 +01:00
sdeleuze 0075f13126 Improve CORS list properties combination logic
This commit allows CorsConfiguration#combine()
to differentiate permit default values set by
CorsConfiguration#applyPermitDefaultValues()
from values configured explicitly by the user.

Those permit default values will be overridden
by any user-provided ones while user-provided values
will be combined in an additive way, including
when "*" is specified.

Documentation has been improved accordingly.

Issue: SPR-15772
2017-12-20 22:38:01 +01:00
Rossen Stoyanchev a8cf275aed MockServerHttpRequest builder supports query params
Issue: SPR-16280
2017-12-19 15:38:12 -05:00
Rossen Stoyanchev 6df1a7874a MockHttpServletResponse uses correct language header
Issue: SPR-16311
2017-12-19 13:56:16 -05:00
Arjen Poutsma 8e253a316d Support top-level scalar values in Jackson2Tokenizer
Issue: SPR-16166
2017-12-14 16:44:40 +01:00
Juergen Hoeller 05988193b7 Upgrade to Jackson 2.9.3 and Netty 4.1.18 2017-12-13 17:55:50 +01:00
sdeleuze 6a7b197af7 Improve Jackson codecs documentation 2017-12-13 12:07:43 +01:00
sdeleuze 73a81f98d4 Allow interceptors to add existing header values
Additional commit to provide support of requests
that have a body.

Issue: SPR-15066
2017-12-13 10:08:24 +01:00
Rossen Stoyanchev f05175586e Refine behavior on error after response committed
If the response is set and we can't change the status through
ServerHttpResponse any more, allow the error signal to propagate and
let the individual server adapters handle it. Ultimately that should
result in closing the connection.

On Servlet containers, we check one last time if the response is
committed (we may not have filled the buffer). If not then save
the exception as a request attribute, dispatch, and re-throw it on the
container thread.

On Undertow access the connection and close it.

On Netty just let the error through to Reactor Netty.

Issue: SPR-16051
2017-12-12 14:51:24 -05:00
Christoph Dreis 260ebeca3a Improve performance of some string operations
Issue: SPR-16293
2017-12-12 17:14:24 +01:00
sdeleuze 554662ebab Allow interceptors to add existing header values
Provide a fully mutable HttpHeaders to ClientHttpRequestInterceptors
of a RestTemplate when headers are set using HttpEntity. This avoids
UnsupportedOperationException if both HttpEntity and
ClientHttpRequestInterceptor add values for the same HTTP header.

Issue: SPR-15066
2017-12-11 15:01:20 +01:00
Juergen Hoeller d198626618 Upgrade to Gradle 4.4 (and Apache HttpClient 4.5.4)
Issue: SPR-16237
2017-12-07 07:28:07 +01:00
Rossen Stoyanchev 203370a810 Handle absolute URI in Reactor request.uri()
The request URI returned from HttpServerRequest.uri() typically
contains contains an absolute path but could also contain an
absolute URI. This commit adds handling for the latter, effectively
taking only the absolute path portion.

Issue: SPR-16243
2017-12-01 23:34:35 -05:00
Rossen Stoyanchev b9a1168580 Consistently return null if certificates not available
Issue: SPR-16244
2017-12-01 21:38:40 -05:00
Rossen Stoyanchev e99b0038a0 Polish 2017-12-01 21:18:13 -05:00
Rossen Stoyanchev dd0d270ba2 Improve error handling when response is committed
ResponseStatusExceptionHandler lets the error through if it can't
change the status while HttpWebHandlerAdapter logs a more helpful
message (including status code) but without a full stack trace.

Issue: SPR-16231
2017-11-29 12:39:06 -05:00
Juergen Hoeller 873cb4e58b Remove unnecessary deprecation suppression 2017-11-29 15:44:08 +01:00
Sam Brannen 2b68212c20 Fix grammar 2017-11-29 14:44:21 +01:00
Rossen Stoyanchev 3650ecc3bb Polish 2017-11-28 22:16:07 -05:00
Rossen Stoyanchev dc3d834026 Refinements related to a committed response
1. setComplete checks the isCommitted flag to avoid an unnecessary
debug message. This method is meant to be safe to call many times.

2. setStatusCode lowers log message to TRACE, since the return value
communicates the outcome it's arguably much less critical.

3. Add comment and test case for ResponseStatusExceptionHandler.
A ResponseStatusException is clearly meant to be handled by this
handler so don't let it pass through even if the respones is
committed.

Issue: SPR-16231
2017-11-27 16:31:49 -05:00
Juergen Hoeller a8323f6a27 Latest dependency updates (OkHttp 3.9.1, JRuby 9.1.14, Rome 1.9) 2017-11-26 16:03:48 +01:00
sdeleuze 3b96690e69 Add missing RestOperations extensions
Issue: SPR-16229
2017-11-23 22:12:03 +01:00
Rossen Stoyanchev 01a82b5291 Improve semantics writing currentData
Before this commit, the return value from write was interpreted as the
data being fully written and ready to be released via releaseData().

This is not true for WebSocketSession implementations where a true
return value simply means the message was sent with the full payload
but releas is not appropriate until a send confirmation.

Technically not an issue since WebSocketSession's extending this do
not use pooled buffers. Nevertheless this commit refines the semantics
of write, removes the releaseData() method, and makes sub-classes
responsible for releasing the buffer when fully written (and they
know best when that is). As a bonus currentData is now private.

Issue: SPR-16207
2017-11-23 10:55:03 -05:00
Rossen Stoyanchev 102a0ad792 Polish 2017-11-23 10:22:35 -05:00
Rossen Stoyanchev c1b191edb0 Polish and improve logging 2017-11-22 23:25:36 -05:00
Rossen Stoyanchev afdca285e5 Avoid resume-suspend race condition
This commit turns suspendReading() into a readingPaused() notification
that is invoked after a succession of reads stops because there is no
more demand. Sub-classes can use this notification to suspend, if that
applies to them.

Most importantly the notification is guaranteed not to overlap with
checkOnDataAvailable() which means that suspend does not need to be
atomic and guarded against resume. The two can and do compete all the
time when reading ends with no demand, and a request for demand arrives
concurrently.

Issue: SPR-16207
2017-11-22 17:48:03 -05:00
sdeleuze 4a87d3da7b Set Vary: Origin on CORS unauthorized response
Issue: SPR-16224
2017-11-22 22:46:53 +01:00
sdeleuze 652e5c5584 Disable CORS credentials by default
Access-Control-Allow-Credentials CORS header, used to
allow cookies with CORS requests, is not set to true
anymore by default when enabling CORS with
@CrossOrigin or global CORS configuration in order to
provide a more secured default CORS configuration.

The related allowCredentials property now requires to
be set to true explicitly in order to support cookies
with CORS requests.

Issue: SPR-16130
2017-11-22 22:46:44 +01:00
Rossen Stoyanchev b7c924cac1 Polish 2017-11-21 23:20:13 -05:00
Rossen Stoyanchev 06b2ab3908 Use volatile for subscriber in base publishers
Issue: SPR-16207
2017-11-21 22:57:15 -05:00
Rossen Stoyanchev 3c2d1862f1 Light refactoring/polish in reactive read/write bridge
Issue: SPR-16207
2017-11-21 21:46:30 -05:00
Violeta Georgieva 2a481c5411 Fix race conditions in AbstractListenerReadPublisher
Transition from DEMAND->NO_DEMAND:
Two concurrent threads enter DEMAND.request and DEMAND.onDataAvailable.
And DEMAND.onDataAvailable finishes before DEMAND.request to be able to
update the demand field then a request for reading will be lost.

Transition from READING->NO_DEMAND:
readAndPublish() returns false because there is no demand but before
switching the states READING.request is invoked again a request for
reading will be lost.

Changing READING->DEMAND/NO_DEMAND is made conditional so that the
operations will be executed only if changing states succeeds.

When in READING state detect completion before each next item in order
to exit sooner, if completed.

Issue: SPR-16207
2017-11-21 14:44:46 -05:00
Violeta Georgieva b814875211 Fix race condition in transition from UNSUBSCRIBED->COMPLETED
- Ensure completion signal (normal/exception) will be delivered to
the subscriber when transition from UNSUBSCRIBED->COMPLETED

- According to the specification "Publisher.subscribe MUST call onSubscribe
on the provided Subscriber prior to any other signals to that Subscriber" so
ensure onComplete/onError signals will be called AFTER onSubscribe signal.

Issue: SPR-16207
2017-11-21 14:44:01 -05:00
Violeta Georgieva 41b13a4e8a Ensure onComplete/onError events will be delivered
Issue: SPR-16207
2017-11-21 14:42:05 -05:00
Juergen Hoeller 0cc644f61f Polishing 2017-11-21 16:34:08 +01:00
sdeleuze 9f1d8517ba Polish Kotlin source code style 2017-11-21 15:59:23 +01:00
Juergen Hoeller 40dacd3c1c Polishing 2017-11-20 22:27:07 +01:00
Juergen Hoeller 040aae5309 Upgrade to Protobuf 3.5 and Apache Johnzon 1.1.5 2017-11-20 12:49:25 +01:00
Andy Clement 508aea8a47 Rework implementation of PathPattern.extractPathWithinPattern
This commit changes the implementation of the PathPattern
extractPathWithinPattern method that used an old AntPathMatcher
derivative to a new version that integrates more closely with
PathContainer.

It also introduces consistency in a couple of areas. The javadoc
is updated to specify this but basically:
- the response from the extra method will have all leading
  and trailing separators removed.
- the response will have multiple adjacent separators within the
  reponse reduced to just one.  (For example response would be
  aaa/bb/cc and not aaa///bbb//cc)
If your response would start or finish with multiple separators, they
are all removed.

Issue: SPR-16120
2017-11-17 12:03:17 -08:00
Violeta Georgieva 0fbfa64385 UndertowServerHttpRequest: suspend reading when no demand
- When there is no demand for reading, the implementation
should suspend reading otherwise useless events will be
send by Undertow to the registered read listener.
- There is not need to wait for an event for reading/writing after calling
resumeReads/resumeWrites
2017-11-16 16:15:55 +01:00
Rossen Stoyanchev 19a9bc4747 Remove unnecessary assertion
Issue: SPR-16201
2017-11-15 16:04:32 -08:00
Rossen Stoyanchev e818b904ad Polish WebSocket-related 2017-11-13 23:20:01 -05:00
Juergen Hoeller 72f20e8d4f Polishing 2017-11-11 00:37:50 +01:00
Rossen Stoyanchev 87375fe6f8 ServerHttpRequest exposes SSL certificates
Issue: SPR-15964
2017-11-10 16:43:12 -05:00
Juergen Hoeller 780993ce75 Polishing 2017-11-10 20:21:26 +01:00
Juergen Hoeller de782026c4 Explicitly document UriTemplate as thread-safe
Issue: SPR-16173
2017-11-10 20:20:23 +01:00
Rossen Stoyanchev a5103307c6 Polish ErrorArgumentResolver 2017-11-10 10:15:46 -05:00
Rossen Stoyanchev 807297f173 Remove RxNetty (from test sources)
Practically no changes to RxNetty for a year and efforts underway to
rebuild 0.6.x based on a current Reactor Netty base.

Aside from the extra time to run integration tests having two
Netty-based servers can also cause false alarms such as ByteBuf leaks
related to RxNetty.
2017-11-09 15:56:56 -05:00
Rossen Stoyanchev 369d33c3d0 Support charset config by (static) resource location
This commit adds support for configuring static resource locations
with a charset to be applied to relative paths.
2017-11-09 13:15:06 -05:00
Rossen Stoyanchev 840ef46a9f Polish
Also remove ErrorDeferredResultProcessingInterceptor which was meant
to be package private to begin with as its peer
ErrorCallableProcessingInterceptor (also removed).
2017-11-08 23:15:31 -05:00
Rossen Stoyanchev 9786750b5a Improve @RequestAttribute WebFlux resolver
The resolver now takes into account the possibility the attribute
itself may be a reactive type.

Issue: SPR-16158
2017-11-06 21:44:45 -05:00
Rossen Stoyanchev 14f02d7192 Update reference with examples of multipart requests
Issue: SPR-16118
2017-11-06 16:33:58 -05:00
Arjen Poutsma af2e296ff3 Javadoc 2017-11-06 16:00:18 +01:00
Arjen Poutsma 2d1f87501c Add MultipartBodyBuilder
This commit introduces the MultipartBodyBuilder, a builder for multipart
form bodies.

Issue: SPR-16134
2017-11-06 10:42:11 +01:00
Juergen Hoeller e5c1deea63 Polishing 2017-11-05 16:23:30 +01:00
Juergen Hoeller 80a0cf71f4 MockHttpServletResponse.getDateHeader returns -1 for non-existent header
Includes consistent getDateHeader results in both MockHttpServletResponse variants (spring-test and spring-web)

Issue: SPR-16160
2017-11-05 16:12:21 +01:00
Juergen Hoeller 0edf4d6509 MockHttpServletRequest.getRequestURL aligns with getServerName/Port
Issue: SPR-16138
2017-11-05 16:11:21 +01:00
Juergen Hoeller 996d747aed Upgrade to Mockito 2.11
Includes fixes for invalid exception declarations in Mockito-based unit tests. Also includes FreeMarker 2.3.27, Commons Pool 2.4.3, JSON-P 1.1.2.

Issue: SPR-16157
2017-11-04 01:06:59 +01:00
Rossen Stoyanchev ef39092b3b UriUtils#encodUriVariables methods are now public 2017-11-03 08:21:55 -04:00
Rossen Stoyanchev 4534c5fbfc AbstractReactiveWebInitializer supports Servlet mapping
Issue: SPR-16155, SPR-16144
2017-11-02 21:03:09 -04:00
Rossen Stoyanchev 8c33ed02b3 ServletHttpHandlerAdapter supports Serlvet path mapping
Issue: SPR-16155
2017-11-02 20:53:26 -04:00
Rossen Stoyanchev aa653b23bc Add AbstractReactiveWebInitializer
This commit introduces a new AbstractReactiveWebInitializer in
spring-web that relies on WebHttpHandlerBuilder to detect request
processing infrastructure beans from an ApplicationContext.

This eliminates the need to create a DispatcherHandler, since it is
expected to be a Spring bean, and as a result the initializers in
spring-webflux have been deprecated.

Issue: SPR-16144
2017-11-02 14:57:06 -04:00
Norman Soetbeer 4dee333a75 Allow empty usernames for BasicAuth
The RFCs around basic authentication don't explicitly disallow empty
usernames. On the other hand usernames containing colons are, as colons
are used to separate the username from the password.
2017-11-02 09:59:14 -05:00
Rossen Stoyanchev 579328bd7a MockClientHttpRequest|Response support cookie headers
Issue: SPR-16124
2017-10-31 12:08:18 -04:00
Juergen Hoeller d06129debd InterceptingHttpAccessor uses internal ArrayList for sorting
Also caches InterceptingClientHttpRequestFactory (if applicable)

Issue: SPR-16137
2017-10-31 16:33:38 +01:00
Rossen Stoyanchev 8083eaae54 syncBody better differentiates plain vs multipart forms
FromHttpMessageWriter and MultipartHttpMessageWriter both support
MultiValueMap except the former supports String values only. This
presents an issue since either full generic type information must be
provided, which is cumbersome on the client side, or if left out there
is no good way to order the writers to make a proper decision.

This commit:

- refines the canWrite behavior of   to not a
accept MultiValueMap without proper generic information unless the
MediaType is explicitly set providing a strong hint.

- modifies MultipartHttpMessageWriter to be configured with a
FormHttpMessageWriter so it can write both plan and multipart data with
the ability to properly differentiate based on actual map values.

Issue: SPR-16131
2017-10-31 09:12:05 -04:00
Arjen Poutsma 49787493a6 Proper Undertow PooledByteBuffer release
This commit changes the way Undertow's PooledByteBuffers are dealt with.
Previously, these buffers where closed as soon as all data was read. As
of this commit, the UndertowServerHttpRequest returns PooledDataBuffers
from getBody(), so that the buffers are released when release() is
called.
2017-10-30 10:39:18 +01:00
Juergen Hoeller d963597ec0 Test with hasError for unknown status code
Issue: SPR-16108
2017-10-24 15:51:29 +02:00
Sebastien Deleuze 1c256a112b Parse correctly ContentDisposition header with semicolons
Issue: SPR-16091
2017-10-23 23:09:14 +02:00
Juergen Hoeller ecea82d3a5 Polishing 2017-10-23 17:14:09 +02:00
Rossen Stoyanchev 1cc5afe24b Fix lines over 120 characters
https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Code-Style#line-wrapping
2017-10-20 16:42:26 -04:00
Andy Wilkinson 07eee05d1d Add missing "be" in Part's javadoc
Closes gh-1570
2017-10-20 16:43:48 +02:00
Rossen Stoyanchev ab92754a2e @MatrixVariable resolvers for WebFlux
The information was already parsed and available in a request attribute
but until now there were no argument resolvers to expose it.

Issue: SPR-16005
2017-10-19 21:01:38 -04:00
Arjen Poutsma c7a15260d6 Various DataBuffer improvements
This commit introduces various improvements in DataBuffer:

- DataBuffer now exposes its read and write position, as well as its
capacity and writable byte count.
- Added DataBuffer.asByteBuffer(int, int)
- DataBufferUtils.read now reads directly into a DataBuffer, rather than
copying a ByteBuffer into a DataBuffer
- TomcatHttpHandler now reads directly into a DataBuffer

Issues: SPR-16068 SPR-16070
2017-10-19 10:38:52 +02:00
Juergen Hoeller 9df6f3e6b8 Polishing 2017-10-18 20:21:49 +02:00
Juergen Hoeller bec1fc1852 ModelAttributeMethodProcessor detects re-enabled binding declaration
Issue: SPR-16083
2017-10-18 12:31:22 +02:00
Juergen Hoeller ea00c7c6c8 Explicit notes on ExceptionHandler root vs cause resolution
Issue: SPR-16074
2017-10-18 12:18:30 +02:00
Rossen Stoyanchev 94c4a7f941 Shortcut factory method in MockServerWebExchange
MockServerWebExchange now has a second factory method that accepts a
MockServerHttpRequest.BaseBuilder.

Issue: SPR-16079
2017-10-17 12:23:12 -04:00
Rossen Stoyanchev 2d05e538fb Set path in CookieWebSessionIdResolver
Issue: SPR-16030
2017-10-16 09:55:58 -04:00
Rossen Stoyanchev 4831d38db2 Lower log level for ResponseStatusException
Issue: SPR-16049
2017-10-16 09:55:58 -04:00
Juergen Hoeller 3890d4c9eb AbstractServerHttpResponse stores HTTP status code as integer value
Issue: SPR-16073
2017-10-16 15:34:09 +02:00
Juergen Hoeller 43b5e21947 Consistent alias declarations for value attribute on stereotypes
Issue: SPR-16066
2017-10-13 18:18:12 +02:00