Add cache-control header to <sid>.json response

This commit is contained in:
Christoph Wiechert
2017-05-09 00:48:20 +02:00
parent e5cd6c581f
commit 6e569924d7

View File

@@ -60,6 +60,7 @@ app.get('/:sid', (req, res, next) => {
const sid = req.params.sid.substr(0, req.params.sid.length-5);
if(!db.get(sid)) return res.status(404).end();
res.header('Cache-control', 'private, max-age=0, no-cache, no-store, must-revalidate');
res.json({
items: db.get(sid).map(data => {
const item = Object.assign(data, {url: `/files/${sid}++${data.key}`});