Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

header capitalization issue #15

Open
ramunasd opened this Issue Mar 15, 2012 · 0 comments

Comments

Projects
None yet
1 participant

Providing headers like AUTHORIZATION: Bearer .. bearer token is not detected, patch:


diff --git a/lib/OAuth2.php b/lib/OAuth2.php
index e88540a..41fd5cc 100644
--- a/lib/OAuth2.php
+++ b/lib/OAuth2.php
@@ -488,7 +488,10 @@ class OAuth2 {
                        $requestHeaders = apache_request_headers();

                        // Server-side fix for bug in old Android versions (a nice side-effect of this fix means we don't care about capitalization f
-                       $requestHeaders = array_combine(array_map('ucwords', array_keys($requestHeaders)), array_values($requestHeaders));
+                       $requestHeaders = array_combine(
+                           array_map('ucwords', array_map('strtolower', array_keys($requestHeaders))),
+                           array_values($requestHeaders)
+                       );

                        if (isset($requestHeaders['Authorization'])) {
                                $headers = trim($requestHeaders['Authorization']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment