From: Brian Quinion Date: Mon, 17 Dec 2012 15:00:49 +0000 (+0000) Subject: only add Access-Control-Allow-Headers if needed X-Git-Tag: v2.2.0~153 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/490190b8739241b84ead87ed47f8a3c65553fe10 only add Access-Control-Allow-Headers if needed --- diff --git a/lib/init-website.php b/lib/init-website.php index 94dba6f4..bcf3ebf7 100644 --- a/lib/init-website.php +++ b/lib/init-website.php @@ -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;