diff --git a/src/libpoketube/init/superinit.js b/src/libpoketube/init/superinit.js index c647bf16..63ac3996 100644 --- a/src/libpoketube/init/superinit.js +++ b/src/libpoketube/init/superinit.js @@ -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;