Add cache-control header to <sid>.json response
This commit is contained in:
@@ -60,6 +60,7 @@ app.get('/:sid', (req, res, next) => {
|
|||||||
const sid = req.params.sid.substr(0, req.params.sid.length-5);
|
const sid = req.params.sid.substr(0, req.params.sid.length-5);
|
||||||
if(!db.get(sid)) return res.status(404).end();
|
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({
|
res.json({
|
||||||
items: db.get(sid).map(data => {
|
items: db.get(sid).map(data => {
|
||||||
const item = Object.assign(data, {url: `/files/${sid}++${data.key}`});
|
const item = Object.assign(data, {url: `/files/${sid}++${data.key}`});
|
||||||
|
|||||||
Reference in New Issue
Block a user