Commit Graph

1111 Commits

Author SHA1 Message Date
Juergen Hoeller 9de28d640e Polishing
(cherry picked from commit 3726c6f)
2016-10-21 12:59:59 +02:00
Sebastien Deleuze 6731e52280 Better encapsulation for CORS default permit configuration
This commit also improves CorsRegistration Javadoc.

Issue: SPR-14798
2016-10-20 17:06:12 +02:00
Sebastien Deleuze f5ecdda400 Remove duplicated elements in CorsConfiguration#combine()
Issue: SPR-14792
2016-10-11 10:53:33 +02:00
Sebastien Deleuze c2031aa651 Polish CorsConfigurationTests 2016-10-11 10:41:14 +02:00
Brian Clozel 8751c9931e 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
(cherry picked from ea5ff87f8e)
2016-10-07 23:19:01 +02:00
Brian Clozel adbf9922f4 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
(cherry picked from 53441f8)
2016-10-06 16:50:27 +02:00
Josh Long 11573b4ea4 fix spelling of word 'recommendation'
this PR fixes the spelling error for the word 'recommendation'
(cherry picked from commit 9b87ea0)
2016-09-22 14:25:25 +02:00
Juergen Hoeller e947363a11 Timeout exceptions as RuntimeExceptions
Issue: SPR-14669
(cherry picked from commit 6dc1898)
2016-09-15 09:05:14 +02:00
Rossen Stoyanchev 5dbfe48d24 Improve async request timeout handling
Rather than setting the status to 503 directly from the timeout
interceptor which no longer seems to work reliably with Servlet
containers like Jetty even performing an additional ERROR dispatch back
to the original URL, we know rather set the DeferredResult to an
AsyncTimeoutException, which results in a dispatch and standard
handling within Spring MVC. This should be a more reliable way of
dealing with timeouts.

Issue: SPR-14669
2016-09-14 21:31:30 -04:00
Brian Clozel 43c60a02f7 Fix response status check in ServletWrbRequest
Issue: SPR-14659
2016-09-06 19:13:03 +02:00
Brian Clozel 6501bc5d32 Align MVC checkNotModified with reactive support
Since SPR-14522, the web reactive framework supports checkNotModified
features. This commit aligns the existing MVC infrastructure with
web reactive's behavior.

Code duplication has been removed from `HttpEntityMethodProcessor`
but the Servlet 2.5 baseline is still respected.

Issue: SPR-14659
Cherry-picked from: cc5300c4d5
2016-09-06 18:17:47 +02:00
Juergen Hoeller c30290b43c @PathVariable supports 'required' attribute (for model attribute methods)
Issue: SPR-14646
(cherry picked from commit e08b1b7)
2016-08-31 14:57:21 +02:00
Juergen Hoeller 37670924f6 Polishing 2016-08-31 01:53:03 +02:00
Juergen Hoeller acbb2544bf Polishing
(cherry picked from commit 4ef428d)
2016-08-31 00:45:25 +02:00
Juergen Hoeller d8f7347000 Consistent comma splitting without regex overhead
Issue: SPR-14635
(cherry picked from commit 03609c1)
2016-08-31 00:44:52 +02:00
Juergen Hoeller 05f74b4218 CommonsMultipartResolver explicitly converts FileSizeLimitExceededException
Issue: SPR-14638
(cherry picked from commit 58ffca7)
2016-08-31 00:44:19 +02:00
Rossen Stoyanchev fe404628e9 Fix media type regression in resource handling
Issue: SPR-14577
2016-08-29 16:39:07 -04:00
Juergen Hoeller 430180aa96 Polishing 2016-08-26 18:33:13 +02:00
Juergen Hoeller e828be96f0 Polishing 2016-08-26 17:29:16 +02:00
Brian Clozel 798d8668a4 Fix server errors for invalid If-None-Match request headers
HttpEntityMethodProcessor should not throw IllegalArgumentExceptions for
invalid If-None-Match headers.

For those cases, this commit makes sure that both
`HttpEntityMethodProcessor` and `ServletWebRequest` have a consistent
behavior and stop processing the request as conditional and leave the
handler handle it.

Issue: SPR-14559
2016-08-26 15:33:02 +02:00
Juergen Hoeller 696f687419 Moved encodeHttpHeaderFieldParam method to HttpHeaders itself (including tests)
This commit also sets the test source encoding to UTF-8.

Issue: SPR-14547
(cherry picked from commit a8f7f75)
2016-08-26 12:55:34 +02:00
Brian Clozel 9b91b9db8c Add RFC5987 support for HTTP header field params
This commit adds support for HTTP header field parameters encoding, as
described in RFC5987.
Note that the default implementation still relies on US-ASCII encoding,
as the latest rfc7230 Section 3.2.4 says that:

> Newly defined header fields SHOULD limit their field values to
  US-ASCII octets

Issue: SPR-14547
Cherry-picked from: f2faf84f31
2016-08-25 14:39:07 +02:00
Juergen Hoeller 184285ab27 Polishing 2016-08-24 13:01:54 +02:00
Juergen Hoeller 1e8065d040 Unit test for empty Access-Control-Request-Headers (Chrome 52)
Includes optimized method/header resolution in CorsConfiguration.

Issue: SPR-14617
(cherry picked from commit d047174)
2016-08-24 11:53:44 +02:00
Juergen Hoeller 5222489a01 Various @since tags (and varargs on setInterceptors)
(cherry picked from commit aac0e63)
2016-08-18 12:40:22 +02:00
Juergen Hoeller 1932a9d729 Polishing
(cherry picked from commit de91b1a)
2016-08-17 21:30:30 +02:00
Juergen Hoeller 35e247aa26 Polishing 2016-08-10 16:21:35 +02:00
Juergen Hoeller 67ba187b6f Polishing
(cherry picked from commit 59a24b4)
2016-08-10 14:57:50 +02:00
Sebastien Deleuze 7c5050cf80 Prevent StackOverflowError in AbstractJackson2HttpMessageConverter
Issue: SPR-14520
2016-08-04 11:28:20 -07:00
Juergen Hoeller 9451177c35 Polishing
(cherry picked from commit 382a931)
2016-07-22 22:45:14 +02:00
Juergen Hoeller 9ed087d5da Consistent support for multiple Accept headers
Issue: SPR-14506
(cherry picked from commit e59a599)
2016-07-22 22:45:04 +02:00
Juergen Hoeller 7b1010cf61 Polishing 2016-07-20 22:31:45 +02:00
Juergen Hoeller 36e1c82ef5 Backported refinements and polishing 2016-07-20 21:46:25 +02:00
Juergen Hoeller b583aa1579 Avoid dependency on WebUtils for extracting file extension
Issue: SPR-14479
(cherry picked from commit adc595b)
2016-07-20 21:44:37 +02:00
Rossen Stoyanchev d98bd34200 Remove isAsyncStarted assertion
Issue: SPR-14444
2016-07-19 16:44:46 -04:00
Sebastien Deleuze 940bdd878e Fix ParameterizedType + contextClass support in Jackson converter
Issue: SPR-14470
2016-07-19 18:10:51 +02:00
Juergen Hoeller 69dd40ec89 Javadoc fixes and pruning of deprecated references 2016-07-15 22:47:05 +02:00
Juergen Hoeller 70e666b4a3 MultipartResolutionDelegate's resolveMultipartArgument properly operates on Servlet 2.5
Issue: SPR-14461
2016-07-15 15:42:32 +02:00
Juergen Hoeller 5c3c0f73c1 Configurable UrlPathHelper in PathExtensionContentNegotiationStrategy
This commit also aligns ResourceUrlProvider's and RequestMappingInfo's UrlPathHelper setter/getter signatures.

Issue: SPR-14454
(cherry picked from commit 84afc60)
2016-07-15 15:37:56 +02:00
fisache 942ead75e2 Polish doc
Closes gh-1108
2016-07-14 19:16:20 +02:00
Juergen Hoeller 3c14911401 Polishing 2016-07-06 17:59:49 +02:00
Juergen Hoeller 92d78c10a2 Polishing (backported from master) 2016-07-06 17:13:18 +02:00
Stephane Nicoll 037746da44 Polish
Closes gh-1097
2016-07-01 14:26:48 +02:00
Juergen Hoeller 1c73664c40 Defensively access deprecated AbstractHttpClient class from Apache HttpComponents
Issue: SPR-14422
2016-07-01 14:11:26 +02:00
Juergen Hoeller 66ec1c1618 Add missing package-info files for common packages
Issue: SPR-14420
2016-06-30 21:39:06 +02:00
Juergen Hoeller 772bc030ee BasicAuthorizationInterceptor belongs to http.client.support
Issue: SPR-14412
2016-06-29 10:41:18 +02:00
Stephane Nicoll db963bc556 Add BasicAuthorizationInterceptor
This commit adds a `ClientHttpRequestInterceptor` that applies a BASIC
authorization header for each request.

It can be used as follows:

```
BasicAuthorizationInterceptor basicAuthorization =
    new BasicAuthorizationInterceptor("user", "secret");
restTemplate.getInterceptors().add(basicAuthorization);
```

Issue: SPR-14412
2016-06-28 17:29:04 +02:00
Rossen Stoyanchev 2cdcf752ba MvcUriComponentsBuilder respects optional params
Issue: SPR-14405
2016-06-27 16:02:54 -04:00
Rossen Stoyanchev e38623df87 Fix MediaType lookup for ResourceHttpRequestHandler
As of 4.3 ResourceHttpRequestHandler delegates to the configured
ContentNegotiationManager, or one created internally, to look up
the media type for are resource.

This commit ensures the internally created ContentNegotiationManager is
correctly injected with the ServletContext through which it can perform
lookups as before.

Also the ServletPathContentNegotiationStrategy now checks the
ServletContext first and then delegates to its parent the
PathContentNegotiationStrategy and not vice versa. This is
consistent with how handleNoMatch (also in the same class) works
and also matches how ResourceHttpRequestHandler worked before 4.3.

Issue: SPR-14368
2016-06-27 14:56:55 -04:00
Juergen Hoeller 15c96b8efd ServletResponseHttpHeaders consistently overrides HttpHeaders again
Issue: SPR-14406
2016-06-27 15:33:53 +02:00