SPR-7706 - 304 responses should not have non-0 Content-Length

This commit is contained in:
Arjen Poutsma
2010-12-20 16:32:58 +00:00
parent 8285e9c2a7
commit db3634f859
3 changed files with 16 additions and 11 deletions

View File

@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -121,11 +121,11 @@ public class ResourceHttpRequestHandler extends WebContentGenerator implements H
}
// header phase
setHeaders(response, resource, mediaType);
if (new ServletWebRequest(request, response).checkNotModified(resource.lastModified())) {
logger.debug("Resource not modified - returning 304");
return;
}
setHeaders(response, resource, mediaType);
// content phase
if (METHOD_HEAD.equals(request.getMethod())) {