specifically deny rwhois referral

small fix for Opera Mobile
This commit is contained in:
HF 2022-09-22 02:46:00 +02:00
parent a24b8bc8f5
commit 31fc38e702
2 changed files with 12 additions and 0 deletions

View File

@ -12,6 +12,15 @@ async function banme(req, res) {
if (code === '1') {
reason = 'Userscript Bot';
} else if (code === '2') {
const ua = req.headers['user-agent'];
if (ua && ua.includes('OPR/')
&& (ua.includes('Android') || ua.includes('iPhone'))
) {
res.json({
status: 'nope',
});
return;
}
reason = 'Captcha Solving Script';
}
const ip = getIPFromRequest(req);

View File

@ -151,6 +151,9 @@ function singleWhoisQuery(
query,
host,
) {
if (host.endsWith(':4321')) {
throw new Error('no rwhois support');
}
return new Promise((resolve, reject) => {
let data = '';
const socket = net.createConnection({