add more servce worker boot controls

disable scarf by default
handle redirect with query
This commit is contained in:
Stewart Allen 2025-10-13 11:45:14 -04:00
commit 3bc0f0cfc2
4 changed files with 62 additions and 37 deletions

8
app.js
View file

@ -526,7 +526,13 @@ function fixedmap(prefix, map) {
// HTTP 307 redirect
function redir(path, type) {
return (req, res, next) => {
http.redirect(res, path, type);
let query = req.url.split('?')[1];
let rpath = path;
if (query && path.indexOf('?') < 0) {
rpath += `?${query}`;
}
// console.log({ redir: req.url, to: path, query, new_path: rpath });
http.redirect(res, rpath, type);
}
}