mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-22 11:37:49 +01:00
add 403 lol
This commit is contained in:
parent
7c5f28552f
commit
65d42eda6f
1 changed files with 17 additions and 4 deletions
|
@ -24,12 +24,25 @@ function init(app, config, rendertemplate) {
|
|||
initlog("wait a few mins... pt on timeout rn");
|
||||
|
||||
|
||||
app.get("/*", function (req, res, next) {
|
||||
if (didstart) return next();
|
||||
function isChromeOS(userAgent) {
|
||||
return userAgent.includes('CrOS');
|
||||
}
|
||||
|
||||
return rendertemplate(res, req, "timeout.ejs");
|
||||
});
|
||||
// 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();
|
||||
|
||||
return rendertemplate(res, req, "timeout.ejs");
|
||||
});
|
||||
|
||||
setTimeout(function () {
|
||||
didstart = true;
|
||||
|
|
Loading…
Reference in a new issue