[MRM-503] Metadata files need Pragma:no-cache response header.

Applied Pragma and Cache-Control headers to maven-metadata.xml requests only.
Added TODO for other filetypes.

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@579747 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Joakim Erdfelt 2007-09-26 18:23:41 +00:00
parent 3565d57261
commit dca8107e77
1 changed files with 17 additions and 6 deletions

View File

@ -146,12 +146,14 @@ public class ProxiedDavServer
}
else
{
// Create parent directories that don't exist when writing a file
// This actually makes this implementation not compliant to the
// WebDAV RFC - but we have enough knowledge
// about how the collection is being used to do this reasonably and
// some versions of Maven's WebDAV don't
// correctly create the collections themselves.
/* Create parent directories that don't exist when writing a file
* This actually makes this implementation not compliant to the
* WebDAV RFC - but we have enough knowledge
* about how the collection is being used to do this reasonably and
* some versions of Maven's WebDAV don't
* correctly create the collections themselves.
*/
File rootDirectory = getRootDirectory();
if ( rootDirectory != null )
{
@ -159,6 +161,15 @@ public class ProxiedDavServer
}
}
// MRM-503 - Metadata file need Pragma:no-cache response header.
if ( request.getLogicalResource().endsWith( "/maven-metadata.xml" ) )
{
response.addHeader( "Pragma", "no-cache" );
response.addHeader( "Cache-Control", "no-cache" );
}
// TODO: determine http caching options for other types of files (artifacts, sha1, md5, snapshots)
davServer.process( request, response );
}