first commit
This commit is contained in:
18
classes/rules/HeadRequestRule.php
Normal file
18
classes/rules/HeadRequestRule.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user