update
This commit is contained in:
@@ -13,7 +13,7 @@ import { getLoginUser } from '../modules/auth.ts';
|
||||
import { rediretHome } from '../modules/user-app/index.ts';
|
||||
import { logger } from '../modules/logger.ts';
|
||||
import { UserV1Proxy } from '../modules/ws-proxy/proxy.ts';
|
||||
import { hasBadUser, userIsBanned, appIsBanned } from '@/modules/off/index.ts';
|
||||
import { hasBadUser, userIsBanned, appIsBanned, userPathIsBanned } from '@/modules/off/index.ts';
|
||||
import { robotsTxt } from '@/modules/html/index.ts';
|
||||
const domain = config?.proxy?.domain;
|
||||
const allowedOrigins = config?.proxy?.allowedOrigin || [];
|
||||
@@ -205,7 +205,11 @@ export const handleRequest = async (req: http.IncomingMessage, res: http.ServerR
|
||||
res.end(robotsTxt);
|
||||
return;
|
||||
}
|
||||
console.log('urls error', urls, 'originUrl:', url);
|
||||
if(userPathIsBanned(_user)) {
|
||||
logger.warn(`Bad user access from IP: ${dns.ip}, Host: ${dns.hostName}, URL: ${req.url}`);
|
||||
} else {
|
||||
console.log('urls error', urls, 'originUrl:', url);
|
||||
}
|
||||
res.writeHead(404, { 'Content-Type': 'text/html' });
|
||||
res.write('Invalid Proxy URL\n');
|
||||
if (hasBadUser(_user)) {
|
||||
|
||||
Reference in New Issue
Block a user