add chromeos back :3

This commit is contained in:
Ashley 2023-12-01 12:59:25 +00:00
parent 1af4edaf18
commit 89850cb02c

View file

@ -24,25 +24,12 @@ function init(app, config, rendertemplate) {
initlog("wait a few mins... pt on timeout rn"); initlog("wait a few mins... pt on timeout rn");
function isChromeOS(userAgent) { app.get("/*", function (req, res, next) {
return userAgent.includes('CrOS'); if (didstart) return next();
}
// Middleware to handle the Chrome OS check return rendertemplate(res, req, "timeout.ejs");
function checkChromeOS(req, res, next) { });
if (isChromeOS(req.headers['user-agent'])) {
res.status(403).send('Forbidden for Chrome OS');
} else {
next();
}
}
// Your existing route with the Chrome OS check
app.get("/*", checkChromeOS, (req, res, next) => {
if (didstart) return next();
return rendertemplate(res, req, "timeout.ejs");
});
setTimeout(function () { setTimeout(function () {
didstart = true; didstart = true;