Commit Graph

1048 Commits

Author SHA1 Message Date
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
Venil Noronha
b2c9c8abcf Add text/markdown MediaType constant
Issue: SPR-14192
2016-04-25 09:57:30 -04:00
Sam Brannen
920eba79f8 Polish Javadoc for DefaultUriTemplateHandler 2016-04-23 16:49:04 +02:00
Rossen Stoyanchev
065b7968a3 Add defaultUriVariables property to RestTemplate
Issue: SPR-14147
2016-04-22 16:21:23 -04:00
Rossen Stoyanchev
0d007a328b Polish DefaultUriTemplateHandler 2016-04-22 16:21:18 -04:00
Johnny Lim
44e652f99e Remove duplicate words
Closes gh-1039
2016-04-19 08:24:21 +02:00
Juergen Hoeller
f1cb793ccb Rename MimeType's getCharSet() to getCharset()
Issue: SPR-14172
2016-04-14 16:38:59 +02:00
Juergen Hoeller
977734cc59 Upgrade to Protobuf Java Format 1.4
Issue: SPR-14171
2016-04-14 15:44:53 +02:00
Juergen Hoeller
62ce9afe3a Jackson-based message converters consistently check media type first
Issue: SPR-14163
2016-04-14 14:26:05 +02:00
Juergen Hoeller
5f4e838f41 Jackson-based message converters do not log warning for serializer not found
Issue: SPR-14163
2016-04-14 14:13:13 +02:00
Juergen Hoeller
3222664024 Avoid unnecessary GenericHttpMessageConverter re-declaration 2016-04-13 19:03:59 +02:00
Juergen Hoeller
96875fe015 Avoid unnecessary GenericHttpMessageConverter re-declaration 2016-04-13 18:52:52 +02:00
Juergen Hoeller
570851e8e4 Consistent headers.getContentLength() checks
(cherry picked from commit 7f438dc)
2016-04-13 18:50:15 +02:00
Juergen Hoeller
e3667467f6 AbstractJackson2HttpMessageConverter's canRead/canWrite checks media type first before delegating to Jackson
Issue: SPR-14163
2016-04-13 18:34:22 +02:00
Tokuhiro Matsuno
741fbcd6fe Fix typo
Closes gh-1013
2016-04-12 08:17:24 +02:00
Johnny Lim
f4b7da9a3e Fix typo
Closes gh-1030
2016-04-12 08:14:53 +02:00
Juergen Hoeller
448621ac58 HttpHeaders consistently ignores invalid date header values
Issue: SPR-14144
2016-04-11 17:45:49 +02:00
Juergen Hoeller
21e4ac1aa2 Upgrade to Netty 4.1
Issue: SPR-14143
2016-04-11 12:20:13 +02:00
Juergen Hoeller
cb9549655c AbstractApplicationContext registers default embedded value resolver
Issue: SPR-14140
2016-04-09 20:49:22 +02:00
Juergen Hoeller
4ae065996b Polishing
(cherry picked from commit aa5c12c)
2016-04-08 23:06:25 +02:00
Juergen Hoeller
37bd51cf6d Handle Resources beyond int length through Servlet 3.1's setContentLengthLong
Issue: SPR-14135
2016-04-08 15:54:24 +02:00
Juergen Hoeller
042d8d0b4c FacesRequestAttributes falls back to ExternalContext as session mutex
Issue: SPR-12402
2016-04-07 11:41:32 +02:00