avoid setting headers for /api/config that will be duplicated by nginx

This commit is contained in:
ansuz 2021-03-03 09:59:04 +05:30
parent 9d6cc55642
commit 3c4b2ffad0

View file

@ -162,6 +162,8 @@ app.use(function (req, res, next) {
return void res.end();
}
if (/^\/api\/config/.test(req.url)) { return void next(); }
setHeaders(req, res);
if (/[\?\&]ver=[^\/]+$/.test(req.url)) { res.setHeader("Cache-Control", "max-age=31536000"); }
else { res.setHeader("Cache-Control", "no-cache"); }