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
1 changed files with 2 additions and 0 deletions

View File

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