-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Resource server Request HTTP header access #188
Fix Resource server Request HTTP header access #188
Conversation
Travis failure is bogus, PHP 5.5 failed because the timing was off-by-one second: https://travis-ci.org/thephpleague/oauth2-server/jobs/30601056 |
} else { | ||
// @codeCoverageIgnoreEnd | ||
$headers = array(); | ||
foreach ($this->server() as $name => $value) { | ||
if (substr($name, 0, 5) == 'HTTP_') { | ||
$name = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5))))); | ||
// HTTP_FOO_BAR becomes FOO-BAR | ||
$name = str_replace(array('HTTP_', '_'), array('', '-'), $name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format of the values is different here, but it doesn't matter because of the normalizeHeaders
call below.
Cheers @shadowhand, I've also removed than annoying assertion that breaks when comparing seconds in v4 |
(oops, didn't mean to close before merging) |
I did a force push, it should be okay to merge now. :) |
Fix Resource server Request HTTP header access
Thanks @alexbilbie! Can you also tag a new release so that we can start using this? |
On it |
Thanks! It fixed our build! 👯 https://travis-ci.org/ushahidi/platform/jobs/30665593 👯 |
Rather than using a raw
new Request
call, which only works with Apache, useRequest:: buildFromGlobals
to work in other scenarios. Also expands and cleans up theUtil\Request::readHeaders
method and adds support for the http extension.