Compare commits

..

2 Commits

Author SHA1 Message Date
0219cc7f83 Merge branch 'proxy' of gitea.moe:lamp/random-miku-server into proxy 2021-11-25 17:02:05 -08:00
47a05b243f relocate cache-control 2021-11-25 17:02:02 -08:00

View File

@ -63,7 +63,6 @@ async function serveId(id, req, res, next) {
res.status(203);
res.type(pxreq.headers.get("Content-Type"));
res.header("Content-Disposition", `filename=${url.split('/').pop()}`);
res.header("Cache-Control", "max-age=99999999999999");
res.header("X-Pixiv-Id", id);
if (req.query.auto) res.header("Refresh", `${Number(req.query.auto)}; url=${getRandomUrl(req)}`);
pxreq.body.pipe(res);
@ -107,6 +106,7 @@ app.get("/img/random", (req, res, next) => {
// simple serve id without redirects
app.get("/img/:id", (req, res, next) => {
res.header("Cache-Control", "max-age=99999999999999");
serveId(req.params.id, req, res, next);
});