18 lines
508 B
PHP
18 lines
508 B
PHP
<?php
|
|
|
|
class HeadRequestRule implements RuleInterface
|
|
{
|
|
public function execute()
|
|
{
|
|
// 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');
|
|
|
|
header('HTTP/1.1 405 Method Not Allowed');
|
|
die('Method Not Allowed');
|
|
}
|
|
return true;
|
|
}
|
|
} |