mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-11-30 12:22:10 +03:00
only add Access-Control-Allow-Headers if needed
This commit is contained in:
parent
0dd10c3fff
commit
490190b873
@ -5,8 +5,11 @@
|
|||||||
{
|
{
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
header("Access-Control-Allow-Methods: OPTIONS,GET");
|
header("Access-Control-Allow-Methods: OPTIONS,GET");
|
||||||
|
if (!empty($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']))
|
||||||
|
{
|
||||||
header("Access-Control-Allow-Headers: ".$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']);
|
header("Access-Control-Allow-Headers: ".$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') exit;
|
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') exit;
|
||||||
|
|
||||||
if (CONST_ClosedForIndexing && strpos(CONST_ClosedForIndexingExceptionIPs, ','.$_SERVER["REMOTE_ADDR"].',') === false)
|
if (CONST_ClosedForIndexing && strpos(CONST_ClosedForIndexingExceptionIPs, ','.$_SERVER["REMOTE_ADDR"].',') === false)
|
||||||
|
Loading…
Reference in New Issue
Block a user