mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-17 00:34:41 -05:00
add chromeos back :3
This commit is contained in:
parent
1af4edaf18
commit
89850cb02c
1 changed files with 4 additions and 17 deletions
|
@ -24,25 +24,12 @@ function init(app, config, rendertemplate) {
|
|||
initlog("wait a few mins... pt on timeout rn");
|
||||
|
||||
|
||||
function isChromeOS(userAgent) {
|
||||
return userAgent.includes('CrOS');
|
||||
}
|
||||
app.get("/*", function (req, res, next) {
|
||||
if (didstart) return next();
|
||||
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
return rendertemplate(res, req, "timeout.ejs");
|
||||
});
|
||||
|
||||
// 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