Skip to content
Snippets Groups Projects
Commit d19cd6f8 authored by felmer's avatar felmer
Browse files

SP-508, BIS-158: Add "Cache-Control: no-cache" to response header instead of...

SP-508, BIS-158: Add "Cache-Control: no-cache" to response header instead of adding a timestamp parameter

SVN: 28386
parent 4db598d2
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,6 @@ public class AttachmentDownloadHelper ...@@ -48,7 +48,6 @@ public class AttachmentDownloadHelper
// NOTE: this exp.getId() could be null if exp is a proxy // NOTE: this exp.getId() could be null if exp is a proxy
methodWithParameters.addParameter(GenericConstants.TECH_ID_PARAMETER, methodWithParameters.addParameter(GenericConstants.TECH_ID_PARAMETER,
attachmentHolder.getId()); attachmentHolder.getId());
methodWithParameters.addParameter("timestamp", System.currentTimeMillis());
return methodWithParameters.toString(); return methodWithParameters.toString();
} }
} }
...@@ -37,7 +37,6 @@ abstract public class AbstractFileDownloadServlet extends AbstractServlet ...@@ -37,7 +37,6 @@ abstract public class AbstractFileDownloadServlet extends AbstractServlet
abstract protected FileContent getFileContent(final HttpServletRequest request) abstract protected FileContent getFileContent(final HttpServletRequest request)
throws Exception; throws Exception;
@Override @Override
protected void respondToRequest(final HttpServletRequest request, protected void respondToRequest(final HttpServletRequest request,
final HttpServletResponse response) throws Exception, IOException final HttpServletResponse response) throws Exception, IOException
...@@ -46,8 +45,9 @@ abstract public class AbstractFileDownloadServlet extends AbstractServlet ...@@ -46,8 +45,9 @@ abstract public class AbstractFileDownloadServlet extends AbstractServlet
if (fileContent != null) if (fileContent != null)
{ {
response.setContentLength(fileContent.getContent().length); response.setContentLength(fileContent.getContent().length);
response.setHeader("Content-Disposition", "attachment; filename=\"" response.setHeader("Content-Disposition",
+ fileContent.getFileName() + "\""); "attachment; filename=\"" + fileContent.getFileName() + "\"");
response.setHeader("Cache-Control", "no-cache");
final ServletOutputStream outputStream = response.getOutputStream(); final ServletOutputStream outputStream = response.getOutputStream();
outputStream.write(fileContent.getContent()); outputStream.write(fileContent.getContent());
outputStream.flush(); outputStream.flush();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment