Skip to content

Commit

Permalink
Merge branch 'main' into SITES-26450
Browse files Browse the repository at this point in the history
  • Loading branch information
LSantha authored Feb 21, 2025
2 parents 68bdb43 + 64acead commit 53551fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ private void sendResponse(InputStream stream, long size, String mimeType, String
response.setContentLength((int) size);
}
if (inline) {
response.setHeader(CONTENT_DISPOSITION_HEADER, "inline");
response.setHeader(CONTENT_DISPOSITION_HEADER, "inline; filename=\"" + filename + "\"");
response.setHeader(CSP_HEADER, "sandbox");
} else {
response.setHeader(CONTENT_DISPOSITION_HEADER, "attachment; filename=\"" + filename + "\"");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void testInlineAssetDownload() throws Exception {
context.requestPathInfo().setExtension("pdf");
downloadServlet.doGet(context.request(), context.response());
assertTrue(context.response().containsHeader("Content-Disposition"));
assertEquals("inline", context.response().getHeader("Content-Disposition"));
assertEquals("inline; filename=\"Download_Test_PDF.pdf\"", context.response().getHeader("Content-Disposition"));
assertTrue(context.response().containsHeader("Content-Security-Policy"));
assertEquals("sandbox", context.response().getHeader("Content-Security-Policy"));
assertEquals(8192, context.response().getBufferSize());
Expand Down

0 comments on commit 53551fe

Please sign in to comment.