Skip to content

Commit

Permalink
Fix. Request header cases are case insensitive.
Browse files Browse the repository at this point in the history
  • Loading branch information
nsilvah committed Oct 25, 2013
1 parent 275529e commit 343b59f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/League/OAuth2/Server/Util/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ protected function readHeaders()
if (function_exists('getallheaders')) {
// @codeCoverageIgnoreStart
$headers = getallheaders();
$headers = array_change_key_case($headers);
} else {
// @codeCoverageIgnoreEnd
$headers = array();
Expand All @@ -101,10 +100,13 @@ protected function getPropertyValue($property, $index = null, $default = null)
return $this->{$property};
}

if ( ! array_key_exists(strtolower($index), $this->{$property})) {
$array_lowcase=array_change_key_case($this->{$property});
$index_lowcase=strtolower($index);

if ( ! array_key_exists($index_lowcase, $array_lowcase)) {
return $default;
}

return $this->{$property}[strtolower($index)];
return $array_lowcase[$index_lowcase];
}
}

0 comments on commit 343b59f

Please sign in to comment.