Normalize request header names.

This commit is contained in:
Michael Wheeler 2014-08-13 14:51:44 -04:00 committed by Eloy Lafuente (stronk7)
parent ba774b42a2
commit 3f4ac1eb9a

View file

@ -754,7 +754,13 @@ class OAuthUtil {
if (function_exists('apache_request_headers')) { if (function_exists('apache_request_headers')) {
// we need this to get the actual Authorization: header // we need this to get the actual Authorization: header
// because apache tends to tell us it doesn't exist // because apache tends to tell us it doesn't exist
return apache_request_headers(); $in = apache_request_headers();
$out = array();
foreach ($in as $key => $value) {
$key = str_replace(" ", "-", ucwords(strtolower(str_replace("-", " ", $key))));
$out[$key] = $value;
}
return $out;
} }
// otherwise we don't have apache and are just going to have to hope // otherwise we don't have apache and are just going to have to hope
// that $_SERVER actually contains what we need // that $_SERVER actually contains what we need