Merge pull request #5899 from annando/avoid-flooding

Avoid beeing flooded by invalid requests
pull/5903/head
Tobias Diekershoff 2018-10-13 08:41:32 +02:00 zatwierdzone przez GitHub
commit 14e7686df4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 7 dodań i 3 usunięć

Wyświetl plik

@ -46,6 +46,10 @@ if ($a->isMaxProcessesReached() || $a->isMaxLoadReached()) {
System::httpExit(503, ['title' => 'Error 503 - Service Temporarily Unavailable', 'description' => 'System is currently overloaded. Please try again later.']);
}
if (strstr($a->query_string, '.well-known/host-meta') and ($a->query_string != '.well-known/host-meta')) {
System::httpExit(404);
}
if (!$a->getMode()->isInstall()) {
if (Config::get('system', 'force_ssl') && ($a->getScheme() == "http")
&& (intval(Config::get('system', 'ssl_policy')) == SSL_POLICY_FULL)

Wyświetl plik

@ -13,7 +13,7 @@ function xrd_init(App $a)
{
if ($a->argv[0] == 'xrd') {
if (empty($_GET['uri'])) {
killme();
System::httpExit(404);
}
$uri = urldecode(notags(trim($_GET['uri'])));
@ -24,7 +24,7 @@ function xrd_init(App $a)
}
} else {
if (empty($_GET['resource'])) {
killme();
System::httpExit(404);
}
$uri = urldecode(notags(trim($_GET['resource'])));
@ -48,7 +48,7 @@ function xrd_init(App $a)
$user = DBA::selectFirst('user', [], ['nickname' => $name]);
if (!DBA::isResult($user)) {
killme();
System::httpExit(404);
}
$profile_url = System::baseUrl().'/profile/'.$user['nickname'];