Skip to content
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

Merged

Conversation

shadowhand
Copy link
Member

Rather than using a raw new Request call, which only works with Apache, use Request:: buildFromGlobals to work in other scenarios. Also expands and cleans up the Util\Request::readHeaders method and adds support for the http extension.

@shadowhand
Copy link
Member Author

cc @philsturgeon @rjmackay

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 2004845 on ushahidi:fix-http-headers-util-request into 7771bc0 on thephpleague:develop.

@shadowhand
Copy link
Member Author

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);
Copy link
Member Author

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.

@alexbilbie
Copy link
Contributor

Cheers @shadowhand, I've also removed than annoying assertion that breaks when comparing seconds in v4

@alexbilbie alexbilbie closed this Jul 23, 2014
@alexbilbie alexbilbie reopened this Jul 23, 2014
@alexbilbie
Copy link
Contributor

(oops, didn't mean to close before merging)

@alexbilbie
Copy link
Contributor

Sorry Github seems to be stuck on this:

screen shot 2014-07-23 at 12 42 42

@alexbilbie alexbilbie closed this Jul 23, 2014
@alexbilbie alexbilbie reopened this Jul 23, 2014
@shadowhand
Copy link
Member Author

I did a force push, it should be okay to merge now. :)

alexbilbie added a commit that referenced this pull request Jul 23, 2014
Fix Resource server Request HTTP header access
@alexbilbie alexbilbie merged commit 00d5fb5 into thephpleague:develop Jul 23, 2014
@shadowhand shadowhand deleted the fix-http-headers-util-request branch July 23, 2014 15:02
@shadowhand
Copy link
Member Author

Thanks @alexbilbie! Can you also tag a new release so that we can start using this?

@alexbilbie
Copy link
Contributor

On it

@shadowhand
Copy link
Member Author

Thanks! It fixed our build! 👯 https://travis-ci.org/ushahidi/platform/jobs/30665593 👯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants