From a08ba009401116dffddc0b0cb972190b47ef3381 Mon Sep 17 00:00:00 2001 From: HF Date: Thu, 22 Sep 2022 09:28:00 +0200 Subject: [PATCH] adjust proxycheck during pixel request --- src/core/draw.js | 5 ++++- src/routes/api/banme.js | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/draw.js b/src/core/draw.js index 2fdf334..4895e4b 100644 --- a/src/core/draw.js +++ b/src/core/draw.js @@ -200,7 +200,10 @@ export default async function drawByOffsets( ); if (needProxycheck) { - await isIPAllowed(ip, true); + const pc = await isIPAllowed(ip, true); + if (pc.status > 0) { + throw new Error(11); + } } for (let u = 0; u < pxlCnt; u += 1) { diff --git a/src/routes/api/banme.js b/src/routes/api/banme.js index 9d7303e..02b4344 100644 --- a/src/routes/api/banme.js +++ b/src/routes/api/banme.js @@ -13,9 +13,7 @@ async function banme(req, res) { reason = 'Userscript Bot'; } else if (code === '2') { const ua = req.headers['user-agent']; - if (ua && ( - (ua.includes('OPR/') && ua.includes('Android')) || ua.includes('iPhone') - )) { + if (ua && (ua.includes('Android') || ua.includes('iPhone'))) { res.json({ status: 'nope', });