add 403 lol

This commit is contained in:
Ashley 2023-11-30 09:30:48 +00:00
parent 7c5f28552f
commit 65d42eda6f

View file

@ -24,12 +24,25 @@ function init(app, config, rendertemplate) {
initlog("wait a few mins... pt on timeout rn"); initlog("wait a few mins... pt on timeout rn");
app.get("/*", function (req, res, next) { function isChromeOS(userAgent) {
return userAgent.includes('CrOS');
}
// Middleware to handle the Chrome OS check
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(); if (didstart) return next();
return rendertemplate(res, req, "timeout.ejs"); return rendertemplate(res, req, "timeout.ejs");
}); });
setTimeout(function () { setTimeout(function () {
didstart = true; didstart = true;