add admin cookie check
This commit is contained in:
@@ -4,15 +4,19 @@ class HeadRequestRule implements RuleInterface
|
||||
{
|
||||
public function execute()
|
||||
{
|
||||
$ip = BotLogger::getRealIp();
|
||||
if (BotLogger::isWhitelisted($ip)) {
|
||||
return true;
|
||||
}
|
||||
// Detect HEAD request with Filter parameters
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'HEAD' && (Tools::getIsset('q') || Tools::getIsset('order'))) {
|
||||
|
||||
|
||||
// Log for Fail2Ban
|
||||
BotLogger::logBan($_SERVER['REMOTE_ADDR'], 'HEAD_REQUEST_SPAM');
|
||||
BotLogger::logBan($ip, 'HEAD_REQUEST_SPAM');
|
||||
|
||||
header('HTTP/1.1 405 Method Not Allowed');
|
||||
die('Method Not Allowed');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user