From 818b71abd66e631c125eac64c009c28111a2f4f2 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Mon, 25 Mar 2019 03:12:08 +0900 Subject: [PATCH] fix Content-Disposition (#4573) --- src/server/file/send-drive-file.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/file/send-drive-file.ts b/src/server/file/send-drive-file.ts index 3f7533b82..e0208f3fa 100644 --- a/src/server/file/send-drive-file.ts +++ b/src/server/file/send-drive-file.ts @@ -64,12 +64,12 @@ export default async function(ctx: Koa.BaseContext) { if (thumb != null) { ctx.set('Content-Type', 'image/jpeg'); - ctx.set('Content-Disposition', contentDisposition('inline', `${rename(file.filename, { suffix: '-thumb', extname: '.jpeg' })}"`)); + ctx.set('Content-Disposition', contentDisposition('inline', `${rename(file.filename, { suffix: '-thumb', extname: '.jpeg' })}`)); const bucket = await getDriveFileThumbnailBucket(); ctx.body = bucket.openDownloadStream(thumb._id); } else { if (file.contentType.startsWith('image/')) { - ctx.set('Content-Disposition', contentDisposition('inline', `${file.filename}"`)); + ctx.set('Content-Disposition', contentDisposition('inline', `${file.filename}`)); await sendRaw(); } else { ctx.status = 404; @@ -83,12 +83,12 @@ export default async function(ctx: Koa.BaseContext) { if (web != null) { ctx.set('Content-Type', file.contentType); - ctx.set('Content-Disposition', contentDisposition('inline', `${rename(file.filename, { suffix: '-web' })}"`)); + ctx.set('Content-Disposition', contentDisposition('inline', `${rename(file.filename, { suffix: '-web' })}`)); const bucket = await getDriveFileWebpublicBucket(); ctx.body = bucket.openDownloadStream(web._id); } else { - ctx.set('Content-Disposition', contentDisposition('inline', `${file.filename}"`)); + ctx.set('Content-Disposition', contentDisposition('inline', `${file.filename}`)); await sendRaw(); } } else {