richardtj / oauth-php

Automatically exported from code.google.com/p/oauth-php
MIT License
0 stars 0 forks source link

Lowercase 'authorization:' header does not work with apache #97

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When the apache_request_headers function is used, the header associative array 
is not normalized to the Upper-Case-Style.

http://code.google.com/p/oauth-php/source/browse/trunk/library/OAuthRequestLogge
r.php#285

I think just removing the 'return' stmt (and the ksort) should do the trick..?

Original issue reported on code.google.com by scherpenisse on 7 Feb 2011 at 2:35

GoogleCodeExporter commented 9 years ago
hmmm... I don't get the bug. ksort should not change anything, just sort the 
keys alphabetically. And apache_request_headers() already returns the data in 
Upper-Case-Style. 

Original comment by brunobg%...@gtempaccount.com on 7 Feb 2011 at 8:40

GoogleCodeExporter commented 9 years ago
With the following test script:

<?php
print_r(apache_request_headers());
?>

curl -H 'authorization: Foo' http://any.any/test.php
Array
(
    [User-Agent] => curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
    [Host] => any.any
    [Accept] => */*
    [authorization] => Foo
)

note the lowercase 'authorization' header. So what you'r saying about 
apache_request_headers() returning the keys in uppercase style is not true..?
I have php version 5.3.3

Original comment by scherpenisse on 8 Feb 2011 at 2:53

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r185.

Original comment by brunobg%...@gtempaccount.com on 8 Feb 2011 at 4:11

GoogleCodeExporter commented 9 years ago
Your request was made with authorization in lowercase. Apache does not 
guarantee Upper-Case-Style (unlike I said before, my mistake: 
http://php.net/manual/en/function.apache-request-headers.php). 

But now I get your bug and your patch. Yes, removing those 2 lines does the 
trick and fixes the problem (r185). Thanks!

Original comment by brunobg%...@gtempaccount.com on 8 Feb 2011 at 4:12