X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/705bcf80fbb35cea677f1a788aa81ab44fa9f6ab..9f880c367c4a9fd8a2950011eeba22c77ab0c914:/website/reverse.php diff --git a/website/reverse.php b/website/reverse.php index 33e6cd5e..c348659e 100755 --- a/website/reverse.php +++ b/website/reverse.php @@ -4,6 +4,22 @@ require_once(dirname(dirname(__FILE__)).'/lib/init-website.php'); require_once(CONST_BasePath.'/lib/log.php'); + if (preg_match(CONST_BlockedUserAgents, $_SERVER["HTTP_USER_AGENT"]) > 0) + { + $fLoadAvg = getLoadAverage(); + if ($fLoadAvg >= CONST_BlockReverseMaxLoad) { + header('HTTP/1.0 403 Forbidden'); + header('Content-type: text/html; charset=utf-8'); + echo "

App temporarily blocked

"; + echo "Your application has been temporarily blocked from the OpenStreetMap Nominatim "; + echo "geolocation service due to high server load."; + echo "\n\n"; + exit; + } + + } + + if (strpos(CONST_BulkUserIPs, ','.$_SERVER["REMOTE_ADDR"].',') !== false) { $fLoadAvg = getLoadAverage();