File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
spring-web/src/main/java/org/springframework/web/filter Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 46
46
*
47
47
* @author Arjen Poutsma
48
48
* @author Rossen Stoyanchev
49
+ * @author Juergen Hoeller
49
50
* @since 3.0
50
51
*/
51
52
public class ShallowEtagHeaderFilter extends OncePerRequestFilter {
@@ -246,6 +247,17 @@ public void setContentLength(int len) {
246
247
}
247
248
}
248
249
250
+ // Overrides Servlet 3.1 setContentLengthLong(long) at runtime
251
+ public void setContentLengthLong (long len ) {
252
+ if (len > Integer .MAX_VALUE ) {
253
+ throw new IllegalArgumentException ("Content-Length exceeds ShallowEtagHeaderFilter's maximum (" +
254
+ Integer .MAX_VALUE + "): " + len );
255
+ }
256
+ if (len > this .content .capacity ()) {
257
+ this .content .resize ((int ) len );
258
+ }
259
+ }
260
+
249
261
@ Override
250
262
public void setBufferSize (int size ) {
251
263
if (size > this .content .capacity ()) {
You can’t perform that action at this time.
0 commit comments