From d30f8016522efff180c26357f107178c0a5f4cd0 Mon Sep 17 00:00:00 2001 From: Michael Goodwin Date: Sun, 22 Oct 2017 14:31:45 -0400 Subject: [PATCH] AmazonS3: Quote file.name for ContentDisposition for files with commas Adds quotes around the filename attribute. See: - https://github.com/RocketChat/Rocket.Chat/issues/8584 - https://stackoverflow.com/questions/38320996/s3-downloading-images-with-comma-in-filename-results-in-neterr-response-heade Fixes #8584 --- packages/rocketchat-file-upload/ufs/AmazonS3/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-file-upload/ufs/AmazonS3/server.js b/packages/rocketchat-file-upload/ufs/AmazonS3/server.js index 048732e8838c..aa7343d7e423 100644 --- a/packages/rocketchat-file-upload/ufs/AmazonS3/server.js +++ b/packages/rocketchat-file-upload/ufs/AmazonS3/server.js @@ -138,7 +138,7 @@ export class AmazonS3Store extends UploadFS.Store { Key: this.getPath(file), Body: writeStream, ContentType: file.type, - ContentDisposition: `inline; filename=${ file.name }` + ContentDisposition: `inline; filename="${ file.name }"` }, (error) => { if (error) {