specifically deny rwhois referral
small fix for Opera Mobile
This commit is contained in:
parent
a24b8bc8f5
commit
31fc38e702
|
@ -12,6 +12,15 @@ async function banme(req, res) {
|
||||||
if (code === '1') {
|
if (code === '1') {
|
||||||
reason = 'Userscript Bot';
|
reason = 'Userscript Bot';
|
||||||
} else if (code === '2') {
|
} 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';
|
reason = 'Captcha Solving Script';
|
||||||
}
|
}
|
||||||
const ip = getIPFromRequest(req);
|
const ip = getIPFromRequest(req);
|
||||||
|
|
|
@ -151,6 +151,9 @@ function singleWhoisQuery(
|
||||||
query,
|
query,
|
||||||
host,
|
host,
|
||||||
) {
|
) {
|
||||||
|
if (host.endsWith(':4321')) {
|
||||||
|
throw new Error('no rwhois support');
|
||||||
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let data = '';
|
let data = '';
|
||||||
const socket = net.createConnection({
|
const socket = net.createConnection({
|
||||||
|
|
Loading…
Reference in New Issue
Block a user