From 9bd1847da5ae7c62fbb294a559d1f97efb7de8d0 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 14 Feb 2021 23:04:56 +0100 Subject: [PATCH] Set Content-Type of raw paste in DocumentHandler --- lib/document_handler.js | 1 + server.js | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/document_handler.js b/lib/document_handler.js index 78ae674..8be4033 100644 --- a/lib/document_handler.js +++ b/lib/document_handler.js @@ -38,6 +38,7 @@ DocumentHandler.prototype.handleGetRaw = async function(key, res, skipExpire){ return; } winston.verbose('retrieved raw document', { key: key }); + res.setHeader('content-type', 'text/plain'); res.status(200).end(data); }; diff --git a/server.js b/server.js index 2179418..d0ae993 100644 --- a/server.js +++ b/server.js @@ -81,7 +81,6 @@ const utils = new HasteUtils(); app.get('/raw/:id', async (req, res) => { const key = req.params.id.split('.')[0]; const skipExpire = Boolean(config.documents[key]); - res.setHeader('content-type', 'text/plain'); return await documentHandler.handleGetRaw(key, res, skipExpire); });