Commit Graph

3224 Commits

Author SHA1 Message Date
Juergen Hoeller 6e4fcb69f0 Polishing 2020-09-25 11:26:01 +02:00
Juergen Hoeller c1617d3c52 Polishing 2020-09-18 18:15:36 +02:00
Juergen Hoeller f010368a66 Polishing 2020-09-15 10:08:01 +02:00
Juergen Hoeller 3c84863271 Polishing 2020-09-14 22:18:30 +02:00
Juergen Hoeller c2f6a98c90 Lenient handling of empty Content-Disposition filename
Closes gh-25769
2020-09-14 22:16:12 +02:00
Arjen Poutsma 07d2c08f48 Do not tokenize Forward header value
This commit remove the tokenization previously used in
UriComponentsBuilder#adaptFromForwardedHeaders, in order to support
Forwarded headers that have multiple, comma-separated 'for' elements.

Closes gh-25737
2020-09-09 16:31:24 +02:00
Juergen Hoeller ae1d15c8f4 Declare protected getCharset method as non-static
See gh-25509
2020-09-08 12:22:25 +02:00
Rossen Stoyanchev b6ff12d2f5 Expose protected method in AbstractJackson2HttpMessageConverter
Closes gh-25509
2020-09-07 21:27:52 +01:00
Rossen Stoyanchev b1d84067cd UriComponentsBuilder Javadoc update
Closes gh-25604
2020-09-07 21:27:52 +01:00
Rossen Stoyanchev 899761f0a8 Avoid unnecessary parsing of path params
See gh-25690
2020-09-07 21:27:52 +01:00
Rossen Stoyanchev f88759c3c9 Shared read-only instances of UrlPathHelper
UrlPathHelper is often created and used without customizations or with
the same customizations. This commit introduces re-usable, instances.
Effectively a backport of commit 23233c.

See gh-25690
2020-09-07 21:27:52 +01:00
Juergen Hoeller 141470ff58 Explicit nullability declarations for getTarget() implementations 2020-09-01 23:26:22 +02:00
Juergen Hoeller d62202f464 Polishing 2020-09-01 10:27:36 +02:00
Juergen Hoeller bcdc2503fa Avoid repeated calls to getPathWithinApplication from getLookupPathForRequest
Closes gh-25669
2020-09-01 10:27:04 +02:00
Juergen Hoeller 6d9d4157ef Specifically detect Joda-Time 2.x
Closes gh-25655
2020-08-28 19:57:51 +02:00
Juergen Hoeller cf2e0c7959 Selected use of ArrayList instead of LinkedList in common places
See gh-25652
2020-08-27 14:14:44 +02:00
Juergen Hoeller 04df9b8f49 Efficient checks for empty strings and single character matches
Closes gh-25552
Closes gh-25553
2020-08-25 16:17:12 +02:00
Juergen Hoeller 9bf5cba3c2 Drop outdated notes on handler type versus handler method restrictions
Closes gh-25482
2020-08-10 14:43:27 +02:00
Juergen Hoeller 8dd285f877 Polishing 2020-08-07 13:02:43 +02:00
Sam Brannen 5576321b04 Reset charset field in MockHttpServletResponse
Prior to this commit, calling reset() on MockHttpServletResponse did not
reset the `charset` field to `false` which could result in the
"Content-Type" header containing `;charset=null` which in turn would
result in errors when parsing the "Content-Type" header.

This commit resets the charset field to `false` in
MockHttpServletResponse's reset() method to avoid such errors.

Closes gh-25501
2020-08-01 14:01:39 +02:00
Sam Brannen 785ab5798a Sync MockHttpServletResponse changes 2020-08-01 12:43:26 +02:00
Sam Brannen 89bb9cb749 Polish Javadoc 2020-08-01 12:26:56 +02:00
Sam Brannen 335c3d5db6 Polish contribution
See gh-25445
2020-07-22 17:26:59 +02:00
XenoAmess ab859fcc96 Refine use of substring operations
Closes gh-25445
2020-07-22 17:26:42 +02:00
Juergen Hoeller 65e601090f Copy queryParams MultiValueMap through addAll (for independent List entries)
Closes gh-25423
2020-07-20 07:07:17 +02:00
Juergen Hoeller 9a618dc7a1 Enforce ConditionalContentCachingResponseWrapper in ShallowEtagHeaderFilter
Closes gh-24976
2020-07-19 19:53:29 +02:00
Juergen Hoeller e9898f7d52 Polishing 2020-07-17 17:48:33 +02:00
Juergen Hoeller 01bab89dba Consistently use PropertySource.getName() for comparison
Includes synchronization for mutators on MutablePropertySources.

Closes gh-25369
2020-07-17 17:45:58 +02:00
Sam Brannen fcf20bab2a Delete duplicate code block in WebHttpHandlerBuilder.applicationContext()
This commit deletes a duplicated code block that was accidentally
introduced in a8a1fc6de5.

Closes gh-25389
2020-07-15 18:58:31 +02:00
Rossen Stoyanchev 03fa48919e Switch to Reactor Dysprosium snapshots
See gh-25376
2020-07-13 16:51:09 +03:00
Arjen Poutsma 5b94d9b00b Use UTF-8 for application/*+json
This commit makes sure that the StringHttpMessageConverter reads
input with "application/*+json" as Content-Type with the UTF-8
character set.

Closes gh-25328
2020-07-01 10:46:58 +02:00
Arjen Poutsma 79c339b03e Support for ASCII in Jackson codec & converter
This commit introduces support for writing JSON with an US-ASCII
character encoding in the Jackson encoder and message converter,
treating it like UTF-8.

See gh-25322
2020-06-30 15:46:54 +02:00
Sam Brannen 9876ca003b Support fragments in UriComponentsBuilder.fromHttpUrl()
Prior to this commit, UriComponentsBuilder.fromHttpUrl() threw an
IllegalArgumentException if the provided URL contained a fragment.

This commit aligns the implementation of fromHttpUrl() with that of
fromUriString(), by parsing a fragment and storing it in the builder.

Closes gh-25300
2020-06-26 18:30:09 +02:00
Sam Brannen dd11dbf3b1 Polish UriComponentsBuilderTests 2020-06-26 14:58:06 +02:00
Juergen Hoeller b0cabb29f3 Polishing 2020-06-23 23:20:45 +02:00
Rossen Stoyanchev 21d069695f Refine solution for 21de09
The following was reported after the change and is related to it:
https://github.com/reactor/reactor-netty/issues/1170. An HTTP HEAD with the body
not consumed. Connection is disposed and closed leading to subsequent request to
fail. Adding toBodilessEntity() helps.

This change does not close the connection but rather drains the body which does
not impact subsequent re-use of the connection. This however may compete with a
late subscriber actually attempting to read the response. At that point there is
little choice but to raise an ISE with a more specific description.

See gh-25216
2020-06-23 19:58:57 +01:00
Juergen Hoeller 9e12a20324 Polishing 2020-06-23 11:35:22 +02:00
Brian Clozel c4326cb0f5 Fix missing contextPath when mutating ServerHttpRequest
This commit ensures that when mutating `ServerHttpRequest` instances,
the original contextPath information is copied to the request being
built.

Note that mutation on the `contextPath(String)` or `path(String)` should
be reflected to the other. (See their Javadoc for more information).

Fixes gh-25279
2020-06-22 19:13:10 +02:00
Arjen Poutsma 405fdd3a57 Map from charset name rather than Charset
With this commit it is no longer assumed that all charset names in the
JsonEncoding can be resolved by Charset.forName. Instead, we store the
charset name itself, rather than the Charset object.
2020-06-22 09:48:41 +02:00
Rossen Stoyanchev f35903f23d Catch IllegalReferenceCountException
Closes gh-22594
2020-06-19 21:58:03 +01:00
Rossen Stoyanchev 21de098756 Dispose on cancel if response not subscribed
Closes gh-25216
2020-06-19 21:58:03 +01:00
Brian Clozel 9b615ed8c6 Fix missing sslInfo with Reactor Netty and http/2
Prior to this commit, the `SslInfo` would be missing for WebFlux apps
when deployed on Reactor Netty with http/2.

This commit ensures that the request adapter checks the current channel
and the parent channel for the presence of the `SslHander`.
In the case of http/2, the `SslHander` is tied to the parent channel.

Fixes gh-25278
2020-06-19 16:43:34 +02:00
Arjen Poutsma 9c3417f703 Convert non-unicode input when reading w/ Jackson
This commit makes sure that Jackson-based message converters and
decoders can deal with non-unicode input. It does so by reading
non-unicode input messages with a InputStreamReader.

This commit also adds additional tests forthe canRead/canWrite methods
on both codecs and message converters.

Closes: gh-25247
2020-06-16 11:45:53 +02:00
Rossen Stoyanchev a2d516d526 Replace "whitelist" with alternative words 2020-06-08 21:19:28 +01:00
Juergen Hoeller c777468056 Polishing 2020-06-08 19:37:58 +02:00
Juergen Hoeller 65154170d3 Polishing 2020-06-06 18:49:32 +02:00
Juergen Hoeller d71957ce7c Polishing 2020-06-06 17:45:12 +02:00
Juergen Hoeller 7244f03064 Avoid unnecessary creation of not-found entity in ResponseEntity#of
Closes gh-25183
2020-06-06 17:44:30 +02:00
Juergen Hoeller f3d4df2fd4 Consistently check available local/remote addresses for non-null 2020-06-06 15:15:16 +02:00
Juergen Hoeller ad5710c1d1 Restore original readOnlyHttpHeaders signature for binary compatibility
Closes gh-25034
2020-06-06 13:14:47 +02:00