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 4646 *
4747 * @author Arjen Poutsma
4848 * @author Rossen Stoyanchev
49+ * @author Juergen Hoeller
4950 * @since 3.0
5051 */
5152public class ShallowEtagHeaderFilter extends OncePerRequestFilter {
@@ -246,6 +247,17 @@ public void setContentLength(int len) {
246247 }
247248 }
248249
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+
249261 @ Override
250262 public void setBufferSize (int size ) {
251263 if (size > this .content .capacity ()) {
You can’t perform that action at this time.
0 commit comments