Repository: incubator-nifi Updated Branches: refs/heads/develop 69f04cbb8 -> a4d21e3cd
NIFI-693: - Filename in Content-Disposition should be quoted. Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/a4d21e3c Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/a4d21e3c Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/a4d21e3c Branch: refs/heads/develop Commit: a4d21e3cd642dcbafa18a3be4995465755487e16 Parents: 69f04cb Author: Matt Gilman <[email protected]> Authored: Wed Jun 17 08:52:17 2015 -0400 Committer: Matt Gilman <[email protected]> Committed: Wed Jun 17 08:52:17 2015 -0400 ---------------------------------------------------------------------- .../main/java/org/apache/nifi/web/StandardNiFiContentAccess.java | 2 +- .../main/java/org/apache/nifi/web/api/ProvenanceResource.java | 4 ++-- .../src/main/java/org/apache/nifi/web/api/TemplateResource.java | 2 +- .../src/main/java/org/apache/nifi/web/servlet/DownloadSvg.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/a4d21e3c/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiContentAccess.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiContentAccess.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiContentAccess.java index 18c888e..2f75004 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiContentAccess.java +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiContentAccess.java @@ -107,7 +107,7 @@ public class StandardNiFiContentAccess implements ContentAccess { // get the file name final String contentDisposition = responseHeaders.getFirst("Content-Disposition"); - final String filename = StringUtils.substringAfterLast(contentDisposition, "filename="); + final String filename = StringUtils.substringBetween(contentDisposition, "filename=\"", "\""); // get the content type final String contentType = responseHeaders.getFirst("Content-Type"); http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/a4d21e3c/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProvenanceResource.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProvenanceResource.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProvenanceResource.java index a2e7ef3..9460f73 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProvenanceResource.java +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProvenanceResource.java @@ -362,7 +362,7 @@ public class ProvenanceResource extends ApplicationResource { contentType = MediaType.APPLICATION_OCTET_STREAM; } - return generateOkResponse(response).type(contentType).header("Content-Disposition", String.format("attachment; filename=%s", content.getFilename())).build(); + return generateOkResponse(response).type(contentType).header("Content-Disposition", String.format("attachment; filename=\"%s\"", content.getFilename())).build(); } /** @@ -461,7 +461,7 @@ public class ProvenanceResource extends ApplicationResource { contentType = MediaType.APPLICATION_OCTET_STREAM; } - return generateOkResponse(response).type(contentType).header("Content-Disposition", String.format("attachment; filename=%s", content.getFilename())).build(); + return generateOkResponse(response).type(contentType).header("Content-Disposition", String.format("attachment; filename=\"%s\"", content.getFilename())).build(); } /** http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/a4d21e3c/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/TemplateResource.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/TemplateResource.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/TemplateResource.java index 7e02198..03debbb 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/TemplateResource.java +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/TemplateResource.java @@ -428,7 +428,7 @@ public class TemplateResource extends ApplicationResource { } // generate the response - return generateOkResponse(template).header("Content-Disposition", String.format("attachment; filename=%s.xml", attachmentName)).build(); + return generateOkResponse(template).header("Content-Disposition", String.format("attachment; filename=\"%s.xml\"", attachmentName)).build(); } /** http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/a4d21e3c/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/java/org/apache/nifi/web/servlet/DownloadSvg.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/java/org/apache/nifi/web/servlet/DownloadSvg.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/java/org/apache/nifi/web/servlet/DownloadSvg.java index d912998..5420a63 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/java/org/apache/nifi/web/servlet/DownloadSvg.java +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/java/org/apache/nifi/web/servlet/DownloadSvg.java @@ -70,7 +70,7 @@ public class DownloadSvg extends HttpServlet { } response.setContentType("image/svg+xml"); - response.setHeader("Content-Disposition", "attachment; filename=" + filename); + response.setHeader("Content-Disposition", "attachment; filename=\"" + filename + "\""); response.setStatus(HttpServletResponse.SC_OK); response.getWriter().print(svg);
