Commit Graph

2064 Commits

Author SHA1 Message Date
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
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
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