Fix RequestLoader autoload + trim bot list
This commit is contained in:
@@ -42,14 +42,7 @@ class RequestLogger
|
||||
'Sogou', 'Exabot', 'facebot',
|
||||
],
|
||||
'Scraper' => [
|
||||
'HTTrack', 'wget', 'curl', 'python-requests',
|
||||
'python-httpx', 'Go-http-client', 'okhttp',
|
||||
'Scrapy', 'Apache-HttpClient', 'Java/',
|
||||
'ruby', 'PhantomJS', 'HeadlessChrome',
|
||||
],
|
||||
'Aggregator' => [
|
||||
'Feedly', 'Feedbin', 'FeedReader', 'Inoreader',
|
||||
'Flipboard', 'Pocket', 'Pinterest',
|
||||
'HTTrack', 'Scrapy', 'PhantomJS', 'HeadlessChrome',
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
@@ -89,6 +89,9 @@ if (strpos($path, '/content/') === 0) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Load RequestLogger for bot detection and request logging
|
||||
require_once __DIR__ . '/../cms/core/class/RequestLogger.php';
|
||||
|
||||
// Bot detection — block known bots/AI scrapers early
|
||||
if (RequestLogger::detectBot() !== null) {
|
||||
http_response_code(403);
|
||||
|
||||
Reference in New Issue
Block a user