From 89850cb02ca6c5c2f51cd2a7276d078da7aa9552 Mon Sep 17 00:00:00 2001 From: Ashley Date: Fri, 1 Dec 2023 12:59:25 +0000 Subject: [PATCH] add chromeos back :3 --- src/libpoketube/init/superinit.js | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/libpoketube/init/superinit.js b/src/libpoketube/init/superinit.js index c647bf1..63ac399 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;