From 490190b8739241b84ead87ed47f8a3c65553fe10 Mon Sep 17 00:00:00 2001 From: Brian Quinion Date: Mon, 17 Dec 2012 15:00:49 +0000 Subject: [PATCH] only add Access-Control-Allow-Headers if needed --- lib/init-website.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.39.5