Skip to content
Snippets Groups Projects
Commit 2e529123 authored by Nick Daugherty's avatar Nick Daugherty
Browse files

Fix how Authorization header is added

parent 9d1850eb
No related branches found
No related tags found
No related merge requests found
......@@ -77,7 +77,10 @@ class WP_Codebird extends Codebird {
$headers = array();
if ( isset( $authorization ) ) {
$headers = array( $authorization, 'Expect:' );
$headers = array(
'Authorization' => str_replace( 'Authorization:', '', $authorization ),
'Expect:' => null
);
}
$remote_params = array(
......@@ -106,9 +109,8 @@ class WP_Codebird extends Codebird {
$remote_params['headers']['authorization'] = $bearer;
} else {
// If this is a standard OAuth GET request, add on the authorization header
// Must be added here because $app_only_auth affects what the header will be
if ( 'GET' == $httpmethod )
$remote_params['headers'][] = $authorization;
$remote_params['headers']['Authorization'] = str_replace( 'Authorization:', '', $authorization );
}
if ( 'GET' == $httpmethod ) {
......@@ -185,7 +187,7 @@ class WP_Codebird extends Codebird {
if ( 200 == $httpstatus )
self::setBearerToken( $reply->access_token );
} else {
$reply['httpstatus'] = $httpstatus;
$reply['httpstatus'] = $httpstatus;å
if ( 200 == $httpstatus )
self::setBearerToken( $reply['access_token'] );
......@@ -243,4 +245,4 @@ class WP_Codebird extends Codebird {
}
return $parsed;
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment