commit | db5a3b8d9cc35ee512b0e090e985bcc4e73c7a26 | [log] [tgz] |
---|---|---|
author | Matthieu Baechler <matthieu.baechler@linagora.com> | Wed Jul 27 11:01:29 2016 +0200 |
committer | Matthieu Baechler <matthieu.baechler@linagora.com> | Wed Jul 27 11:01:29 2016 +0200 |
tree | 85a1ee8d6c4f8483c6139567e5608e0b16d78b70 | |
parent | fbc09db2f877d32b2f6d57e96ae06c96668f0842 [diff] | |
parent | 612ca203fec6660d0756217a416e61c461fd2b92 [diff] |
Merge remote-tracking branch 'laura/JAMES-1809'
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java index 98dd128..6ef8a03 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java
@@ -330,6 +330,6 @@ @Then("^the attachment is named \"([^\"]*)\"$") public void assertContentDisposition(String name) throws IOException { - assertThat(response.getHeaders("Content-Disposition")).extracting(Header::toString).containsExactly("Content-Disposition: " + name); + assertThat(response.getHeaders("Content-Disposition")).extracting(Header::toString).containsExactly("Content-Disposition: attachment; filename=\"" + name + "\""); } }
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/DownloadServlet.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/DownloadServlet.java index 49d0c79..d54a7e3 100644 --- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/DownloadServlet.java +++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/DownloadServlet.java
@@ -129,9 +129,10 @@ } private void addContentDispositionHeader(Optional<String> optionalName, HttpServletResponse resp) { - optionalName.ifPresent(name -> resp.addHeader("Content-Disposition", name)); + optionalName.ifPresent(name -> resp.addHeader("Content-Disposition", "attachment; filename=\"" + name + "\"")); } + private MailboxSession getMailboxSession(HttpServletRequest req) { return (MailboxSession) req.getAttribute(AuthenticationFilter.MAILBOX_SESSION); }