forked from ppfun/pixelplanet
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') {
|
||||
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);
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue
Block a user