mirror of
https://github.com/SunRed/haste-server.git
synced 2024-11-01 01:30:21 +01:00
Set Content-Type of raw paste in DocumentHandler
This commit is contained in:
parent
e4998cb94c
commit
9bd1847da5
2 changed files with 1 additions and 1 deletions
|
@ -38,6 +38,7 @@ DocumentHandler.prototype.handleGetRaw = async function(key, res, skipExpire){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
winston.verbose('retrieved raw document', { key: key });
|
winston.verbose('retrieved raw document', { key: key });
|
||||||
|
res.setHeader('content-type', 'text/plain');
|
||||||
res.status(200).end(data);
|
res.status(200).end(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,6 @@ const utils = new HasteUtils();
|
||||||
app.get('/raw/:id', async (req, res) => {
|
app.get('/raw/:id', async (req, res) => {
|
||||||
const key = req.params.id.split('.')[0];
|
const key = req.params.id.split('.')[0];
|
||||||
const skipExpire = Boolean(config.documents[key]);
|
const skipExpire = Boolean(config.documents[key]);
|
||||||
res.setHeader('content-type', 'text/plain');
|
|
||||||
return await documentHandler.handleGetRaw(key, res, skipExpire);
|
return await documentHandler.handleGetRaw(key, res, skipExpire);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue