We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae153c1 commit 2336c3cCopy full SHA for 2336c3c
lib/class-wp-json-authentication-oauth1.php
@@ -60,6 +60,16 @@ public function parse_header( $header ) {
60
61
}
62
63
+ /**
64
+ * Get the authorization header
65
+ *
66
+ * On certain systems and configurations, the Authorization header will be
67
+ * stripped out by the server or PHP. Typically this is then used to
68
+ * generate `PHP_AUTH_USER`/`PHP_AUTH_PASS` but not passed on. We use
69
+ * `getallheaders` here to try and grab it out instead.
70
71
+ * @return string|null Authorization header if set, null otherwise
72
+ */
73
public function get_authorization_header() {
74
if ( ! empty( $_SERVER['HTTP_AUTHORIZATION'] ) ) {
75
return wp_unslash( $_SERVER['HTTP_AUTHORIZATION'] );
0 commit comments