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); });