Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.4-M1
-
Fix Version/s: 1.4-M3
-
Component/s: None
-
Labels:None
-
Environment:RHEL 6
-
Testcase included:yes
-
Patch Submitted:Yes
-
Number of attachments :
Description
Looks like there might be an issue with how cache control header is added. This should use setHeader instead of an addHeader to protect against adding duplicate headers.
private void setHeaders( DavServletResponse response, DavResourceLocator locator, DavResource resource )
{
// MRM-503 - Metadata file need Pragma:no-cache response
// header.
if ( locator.getResourcePath().endsWith( "/maven-metadata.xml" ) )
// We need to specify this so connecting wagons can work correctly
response.addDateHeader( "last-modified", resource.getModificationTime() );
// TODO: MRM-524 determine http caching options for other types of files (artifacts, sha1, md5, snapshots)
}
See below for a sample result with duplicate header. Cache control header with public was added through servlet filter but then another cache control header got added. Expected result should be that it should overwrite the exiting header:
< HTTP/1.1 200 OK
< Cache-Control: public, max-age=600, s-maxage=600 < Pragma: no-cache < Cache-Control: no-cache < Last-Modified: Thu, 19 Jul 2012 22:09:53 GMT < Content-Length: 3376 < Vary: Accept-Encoding < Connection: close < Content-Type: application/xml;charset=UTF-8
applied.
Thanks!