]> git.openstreetmap.org Git - nominatim.git/commitdiff
only add Access-Control-Allow-Headers if needed
authorBrian Quinion <openstreetmap@brian.quinion.co.uk>
Mon, 17 Dec 2012 15:00:49 +0000 (15:00 +0000)
committerBrian Quinion <openstreetmap@brian.quinion.co.uk>
Mon, 17 Dec 2012 15:00:49 +0000 (15:00 +0000)
lib/init-website.php

index 94dba6f4a15599675da89c7e484a334692035b39..bcf3ebf7a0aeb6674e874ebbf3ed7413572373dc 100644 (file)
@@ -5,7 +5,10 @@
        {
                header("Access-Control-Allow-Origin: *");
                header("Access-Control-Allow-Methods: OPTIONS,GET");
-               header("Access-Control-Allow-Headers: ".$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']);
+               if (!empty($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']))
+               {
+                       header("Access-Control-Allow-Headers: ".$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']);
+               }
        }
        if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') exit;