Skip to content

Commit

Permalink
exclude oauth_verifier from the body
Browse files Browse the repository at this point in the history
  • Loading branch information
viniychuk committed May 2, 2017
1 parent a3df975 commit 4703dde
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/TwitterOAuth.php
Expand Up @@ -347,6 +347,11 @@ private function oAuthRequest($url, $method, array $parameters)
if ($this->bearer === null) {
$request->signRequest($this->signatureMethod, $this->consumer, $this->token);
$authorization = $request->toHeader();
if (array_key_exists('oauth_verifier', $parameters)) {
// Twitter doesn't always work with oauth in the body and in the header
// and it's already included in the $authorization header
unset($parameters['oauth_verifier']);
}
} else {
$authorization = 'Authorization: Bearer ' . $this->bearer;
}
Expand Down

0 comments on commit 4703dde

Please sign in to comment.