Compare commits
No commits in common. "0219cc7f835fd46465ff24f96e2ca28d4a554098" and "93017002b908b37956dcaf9d8349a739ab0fd672" have entirely different histories.
0219cc7f83
...
93017002b9
2
index.js
2
index.js
@ -63,6 +63,7 @@ async function serveId(id, req, res, next) {
|
|||||||
res.status(203);
|
res.status(203);
|
||||||
res.type(pxreq.headers.get("Content-Type"));
|
res.type(pxreq.headers.get("Content-Type"));
|
||||||
res.header("Content-Disposition", `filename=${url.split('/').pop()}`);
|
res.header("Content-Disposition", `filename=${url.split('/').pop()}`);
|
||||||
|
res.header("Cache-Control", "max-age=99999999999999");
|
||||||
res.header("X-Pixiv-Id", id);
|
res.header("X-Pixiv-Id", id);
|
||||||
if (req.query.auto) res.header("Refresh", `${Number(req.query.auto)}; url=${getRandomUrl(req)}`);
|
if (req.query.auto) res.header("Refresh", `${Number(req.query.auto)}; url=${getRandomUrl(req)}`);
|
||||||
pxreq.body.pipe(res);
|
pxreq.body.pipe(res);
|
||||||
@ -106,7 +107,6 @@ app.get("/img/random", (req, res, next) => {
|
|||||||
|
|
||||||
// simple serve id without redirects
|
// simple serve id without redirects
|
||||||
app.get("/img/:id", (req, res, next) => {
|
app.get("/img/:id", (req, res, next) => {
|
||||||
res.header("Cache-Control", "max-age=99999999999999");
|
|
||||||
serveId(req.params.id, req, res, next);
|
serveId(req.params.id, req, res, next);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user