diff --git a/lib/class-wp-rest-oauth1.php b/lib/class-wp-rest-oauth1.php index 268001f..edc2538 100644 --- a/lib/class-wp-rest-oauth1.php +++ b/lib/class-wp-rest-oauth1.php @@ -77,9 +77,11 @@ public function get_authorization_header() { $headers = getallheaders(); // Check for the authoization header case-insensitively - foreach ( $headers as $key => $value ) { - if ( strtolower( $key ) === 'authorization' ) { - return $value; + if ( is_array( $headers ) ) { + foreach ( $headers as $key => $value ) { + if ( strtolower( $key ) === 'authorization' ) { + return $value; + } } } }