File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
spring-web/src/main/java/org/springframework/web/util Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,9 @@ public PrintWriter getWriter() throws IOException {
123
123
124
124
@ Override
125
125
public void setContentLength (int len ) {
126
- this .content .resize (len );
126
+ if (len > this .content .size ()) {
127
+ this .content .resize (len );
128
+ }
127
129
this .contentLength = len ;
128
130
}
129
131
@@ -134,13 +136,17 @@ public void setContentLengthLong(long len) {
134
136
Integer .MAX_VALUE + "): " + len );
135
137
}
136
138
int lenInt = (int ) len ;
137
- this .content .resize (lenInt );
139
+ if (lenInt > this .content .size ()) {
140
+ this .content .resize (lenInt );
141
+ }
138
142
this .contentLength = lenInt ;
139
143
}
140
144
141
145
@ Override
142
146
public void setBufferSize (int size ) {
143
- this .content .resize (size );
147
+ if (size > this .content .size ()) {
148
+ this .content .resize (size );
149
+ }
144
150
}
145
151
146
152
@ Override
You can’t perform that action at this time.
0 commit comments