Use Content-Type header stored in CONTENT_TYPE per RFC 3875

Normalize $_SERVER['CONTENT_TYPE'] with value from $_SERVER['HTTP_CONTENT_TYPE']
This commit is contained in:
Zach Borboa
2014-04-17 22:14:49 -07:00
parent e1ef501ea1
commit 7bbed34b16
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -4,6 +4,9 @@ $_PUT = array();
$_PATCH = array();
$request_method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : '';
if (!array_key_exists('CONTENT_TYPE', $_SERVER) && array_key_exists('HTTP_CONTENT_TYPE', $_SERVER)) {
$_SERVER['CONTENT_TYPE'] = $_SERVER['HTTP_CONTENT_TYPE'];
}
$content_type = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : '';
$data_values = $_GET;
if ($request_method === 'POST') {