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 getallheaders support for FastCGI and other servers then Apache #28

Closed
GoogleCodeExporter opened this issue May 27, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

You use the function getallheaders() a couple of time in the OAuth library.
This only works in Apache. I've created a function which also works in
Lighttpd and Apache PHP FastCGI.

Here you can find it: http://pastie.org/855575


I've put it in the class OAuthRequest as static method. And replaced all
getallheaders() with OAuthRequest::getAllHeaders();

Original issue reported on code.google.com by michiele...@gmail.com on 5 Mar 2010 at 2:27

@GoogleCodeExporter
Copy link
Author

Thanks a lot! I added it to the SVN, with two slight changes:

- added to OAuthRequestLogger instead
- apache_request_headers() is returned as is, without passing through the 
foreach loop.

Unless you have something to add, I'll consider this fixed.

Original comment by brunobg%...@gtempaccount.com on 5 Mar 2010 at 10:12

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Well I wouldn't expect that function in OAuthRequestLogger, because it's not a
logging function, but an utility function used to extract headers from the 
webserver.
So in my opinion I shouldn't add it to the Logger class. I added it the 
OAuthRequest,
because there are the other utility functions as well, as parse_url and stuff 
like
that. So that's where I should expect it.

The apache_request_headers() can be returned as is yes. But please add there a 
ksort
as well. So you will get the same sorting order as with $_SERVER and $_ENV. 
This will
minimize the differences between the 2 methods.

Besides this, I consider it fixed as well.

Original comment by michiele...@gmail.com on 6 Mar 2010 at 9:06

@GoogleCodeExporter
Copy link
Author

I agree that Logger is not the most logical place, but it's the lowest common
dependency and it also uses this function. I added the ksort and closing this. 
Thanks
again for the patch.

Original comment by brunobg%...@gtempaccount.com on 8 Mar 2010 at 12:46

  • Changed state: Fixed

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

No branches or pull requests

1 participant