diff --git a/class-wp-codebird.php b/class-wp-codebird.php index a9333711a770d05529d140fbc7f46d15d3b94bc5..4cc2d714957744711972807480be566356582059 100644 --- a/class-wp-codebird.php +++ b/class-wp-codebird.php @@ -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 +}