Restored capacity check before trying output stream resize

Issue: SPR-13671
This commit is contained in:
Juergen Hoeller 2015-11-12 00:47:33 +01:00
parent e707347474
commit 43d72e2079
1 changed files with 9 additions and 3 deletions

View File

@ -123,7 +123,9 @@ public class ContentCachingResponseWrapper extends HttpServletResponseWrapper {
@Override
public void setContentLength(int len) {
this.content.resize(len);
if (len > this.content.size()) {
this.content.resize(len);
}
this.contentLength = len;
}
@ -134,13 +136,17 @@ public class ContentCachingResponseWrapper extends HttpServletResponseWrapper {
Integer.MAX_VALUE + "): " + len);
}
int lenInt = (int) len;
this.content.resize(lenInt);
if (lenInt > this.content.size()) {
this.content.resize(lenInt);
}
this.contentLength = lenInt;
}
@Override
public void setBufferSize(int size) {
this.content.resize(size);
if (size > this.content.size()) {
this.content.resize(size);
}
}
@Override