Commit Graph

1070 Commits

Author SHA1 Message Date
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
Rossen Stoyanchev
919f6c96f9 ForwardedHeaderFilter is case-insensitive
Issue: SPR-14372
2016-06-17 14:20:42 -04:00
Juergen Hoeller
dcb2c73102 MultipartResolutionDelegate skips Part parameter checks on Servlet 2.5
Issue: SPR-14358
2016-06-14 22:48:51 +02:00
Juergen Hoeller
1dfc0ffd43 SpringHandlerInstantiator supports all HandlerInstantiator-provided factory methods
Issue: SPR-14347
2016-06-09 17:02:39 +02:00
Juergen Hoeller
a211d1472e Polishing 2016-06-08 15:22:01 +02:00
Juergen Hoeller
cc7781ecf3 FormHttpMessageConverter's charset (and its UTF-8 default) applies to part converters as well
Issue: SPR-14338
2016-06-08 13:58:44 +02:00
Juergen Hoeller
8fc84e2d6f Upgrade to Jackson 2.8 RC1, Undertow 1.4 CR1, Netty 4.1.1
Issue: SPR-14340
Issue: SPR-14328
Issue: SPR-14143
2016-06-08 09:47:51 +02:00
Juergen Hoeller
981c894acf @ExceptionHandler matches against cause type as well
Issue: SPR-14291
2016-06-07 21:22:01 +02:00
Juergen Hoeller
31aed61d15 CorsFilter asserts presence of CorsConfigurationSource 2016-06-07 16:49:23 +02:00
Juergen Hoeller
8c4bc3656b Polishing 2016-06-07 15:42:16 +02:00
Juergen Hoeller
6807bcb863 Fixed @since references after SPR-14080 backport
Issue: SPR-14305
(cherry picked from commit 9a41774)
2016-06-07 13:38:17 +02:00
Juergen Hoeller
c412eabb00 Jackson2ObjectMapperBuilder/FactoryBean accepts deserializers by handled type
Issue: SPR-14337
2016-06-07 12:50:00 +02:00
Juergen Hoeller
abcfffdde9 Allow JAXB to be registered next to plain Jackson
Issue: SPR-14336
2016-06-07 12:36:17 +02:00
Rossen Stoyanchev
c2a50ad1bf Fine-tune X-Forwarded header in ForwardedHeaderFilter
The contextPathOverride property is now gone.
X-Forwarded-Header (if present) is used instead of the contextPath.

Issue: SPR-14270
2016-06-06 12:37:22 -04:00
Juergen Hoeller
521c41d75e Polishing 2016-06-02 17:02:44 +02:00
Juergen Hoeller
7de61f80a7 AbstractRequestLoggingFilter supports logging of request headers
Issue: SPR-14245
2016-06-02 11:41:24 +02:00
Juergen Hoeller
ea728b15c8 Polishing 2016-06-01 22:01:32 +02:00
Rossen Stoyanchev
c74d979735 Rename contextPath method in ForwardedHeaderFilter 2016-06-01 15:45:44 -04:00
Rossen Stoyanchev
1f3ac340fa Polish X-Forwarded-Prefix handling
Issue: SPR-14270
2016-06-01 15:33:19 -04:00
Eddú Meléndez
7ee687c798 Support X-Forwarded-Prefix in ForwardedHeaderFilter
See SPR-14270
2016-06-01 14:28:19 -04:00
Rossen Stoyanchev
92f1b69e8c Update MultipartFilter documentations
Issue: SPR-11373
2016-05-31 12:42:32 -04:00
Juergen Hoeller
f7f2327f60 ServletServerHttpRequest.getHeaders() ignores invalid content type
Issue: SPR-14309
2016-05-29 13:22:00 +02:00
Johnny Lim
ace624a01a Polish Javadoc in MediaType
Closes gh-1064
2016-05-25 09:23:27 +02:00
Rossen Stoyanchev
400206a2fe Update @RestController javadoc
Issue: SPR-13945
2016-05-22 09:06:23 -04:00
Juergen Hoeller
5682950289 Polishing 2016-05-06 12:03:10 +02:00
Juergen Hoeller
42d32ba396 ResourceRegion fits better in core.io.support (next to EncodedResource)
Issue: SPR-14221
2016-05-06 12:02:51 +02:00
Juergen Hoeller
08ddd1b3bc AbstractRequestLoggingFilter ignores non-available query string
Issue: SPR-14244
2016-05-04 18:17:06 +02:00
Sam Brannen
7b13311f03 Delete unused imports 2016-05-03 20:12:37 +02:00
Sam Brannen
6b3eba0500 Suppress warnings in Gradle build 2016-05-03 19:56:33 +02:00
Juergen Hoeller
52e5b4a6ff Polishing 2016-05-03 18:55:39 +02:00
Juergen Hoeller
76964e16ef Explicit note on Java deserialization 2016-05-03 18:44:37 +02:00
Brian Clozel
05b29a4a17 Add convenient getters for force*Encoding attributes
Issue: SPR-14240
2016-05-03 16:14:09 +02:00
Brian Clozel
76ee46847a Selectively force encoding in CharacterEncodingFilter
Prior to this commit, setting the `forceEncoding` option would force
encoding on both requests and responses.

This commit adds two new setters and a new constructor to differentiate
both options: forcing the encoding on the request and/or on the
response.

You can now define this filter programmatically using those options or
update your servlet XML configuration like:

```
<filter>
  <filter-name>characterEncodingFilter</filter-name>
  <filter-class>o.sf.web.filter.CharacterEncodingFilter</filter-class>
  <init-param>
     <param-name>encoding</param-name>
     <param-value>UTF-8</param-value>
  </init-param>
  <init-param>
    <param-name>forceRequestEncoding</param-name>
    <param-value>true</param-value>
  </init-param>
  <init-param>
    <param-name>forceResponseEncoding</param-name>
    <param-value>false</param-value>
  </init-param>
</filter>

```

Issue: SPR-14240
2016-05-03 14:47:22 +02:00
Brian Clozel
5ac31fb39d Refactor HTTP Range support with ResourceRegion
Prior to this commit, the `ResourceHttpMessageConverter` would support
all HTTP Range requests and `MethodProcessors` would "wrap" controller
handler return values with a `HttpRangeResource` to support that use
case in Controllers.

This commit refactors that support in several ways:
* a new ResourceRegion class has been introduced
* a new, separate, ResourceRegionHttpMessageConverter handles the HTTP
range use cases when serving static resources with the
ResourceHttpRequestHandler
* the support of HTTP range requests on Controller handlers has been
removed until a better solution is found

Issue: SPR-14221, SPR-13834
2016-05-02 19:00:52 +02:00
Brian Clozel
29da44c8dc Support ETags with special chars in ServletWebRequest
This commit makes sure that HTTP request headers containing ETag values
are properly parsed and not simply tokenized using a "," separator.
Indeed, ETags can legally contain separator characters such as " " and
",".

Issue: SPR-14216
2016-04-29 11:20:29 +02:00
Brian Clozel
55dae618a6 Improve multi-valued HTTP headers support
Prior to this change, getting header values with `HttpHeaders` when
headers are multi-valued would cause issues.
For example, for a given HTTP message with headers:
    Cache-Control: public, s-maxage=50
    Cache-Control: max-age=42

Getting a `List` of all values would return <"public", "s-maxage=50">
and getting the header value would return "public, s-maxage=50".

This commit takes now into account multi-valued HTTP headers and adds
new getters/setters for "If-Match" and "If-Unmodified-Since" headers.

Note that for ETag-related headers such as "If-Match" and
"If-None-Match", a special parser has been implemented since ETag values
can contain separator characters.

Issue: SPR-14223, SPR-14228
2016-04-28 18:48:47 +02:00
Juergen Hoeller
9412f7a094 InstantFormatter accepts RFC-1123 values as well
Issue: SPR-14201
2016-04-28 14:35:33 +02:00
Rossen Stoyanchev
335d968f85 Polish DefaultUrlTemplateHandler 2016-04-27 08:55:52 -04:00
Brian Clozel
a50ea80e4e Handle multiple conditional request headers
Prior to this change, setting both "If-None-Match" and
"If-Unmodified-Since" conditional request headers would check for both
conditions to be met.

This commit fixes this behavior to follow the RFC7232 Section 6:
> entity tags are presumed to be more accurate than date validators

So in case both conditions are present, the "If-None-Match" condition
takes precedence.

Issue: SPR-14224
2016-04-27 12:02:33 +02:00
Juergen Hoeller
d06188ed4d ResponseEntity allows for setting non-standard status code
Issue: SPR-14205
2016-04-26 23:06:10 +02:00
Juergen Hoeller
e5d52a96a7 HttpSessionRequiredException programmatically exposes name of expected attribute
Issue: SPR-14206
2016-04-26 23:06:10 +02:00
Rossen Stoyanchev
538c582342 Extract AbstractUriTemplateHandler base class
Issue: SPR-14147
2016-04-26 13:32:35 -04:00
Juergen Hoeller
f73df2e138 SpringServletContainerInitializer does not log WebApplicationInitializer class names
Issue: SPR-14213
2016-04-26 17:09:57 +02:00