From a2e3ac177095740e449fa2c4a8ec343c26951e94 Mon Sep 17 00:00:00 2001 From: Vandecappelle Date: Thu, 20 Jul 2017 00:19:10 +0200 Subject: [PATCH] Header settings on content disposition Allow to not insert content disposition into headers. Keeping by default the content disposition. --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index a7fb771..da8e304 100644 --- a/index.js +++ b/index.js @@ -231,9 +231,13 @@ var downloadHeader = function (res, info) { "Cache-Control": "public; max-age=" + settings.maxAge, Connection: "keep-alive", "Content-Type": info.mime, - "Content-Disposition": "inline; filename=" + info.file + ";", "Accept-Ranges": "bytes" }; + + if (settings.insertContentDisposition == undefined || settings.insertContentDisposition){ + header["Content-Disposition"] = "inline; filename=" + info.file + ";" + } + if (info.rangeRequest) { // Partial http response