X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/7a4d550c7aa7d89fd3c27e18dad7470945576a73..9054b865c09723ff95be6a8c87f4a8b98b4cf318:/website/reverse.php diff --git a/website/reverse.php b/website/reverse.php index ab68a849..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(); @@ -75,7 +91,7 @@ $iMaxRank = (isset($_GET['zoom']) && isset($aZoomRank[$_GET['zoom']]))?$aZoomRank[$_GET['zoom']]:28; // Find the nearest point - $fSearchDiam = 0.0001; + $fSearchDiam = 0.0004; $iPlaceID = null; $aArea = false; $fMaxAreaDistance = 1;