Skip to content

Commit

Permalink
[FIX] Authentication header for bearer access-token was set twice by …
Browse files Browse the repository at this point in the history
…this extension and by api-library, which resulted in a 400 Bad response from Nginx
  • Loading branch information
Moongazer committed Jul 13, 2023
1 parent f7bce8f commit d1d69af
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Classes/Mautic/OAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function isAuthorized()
}

/**
* Make a request to server using the supported auth method
* Make a request to server
*
* @param string $url
* @param string $method
Expand All @@ -75,10 +75,6 @@ public function isAuthorized()
*/
public function makeRequest($url, array $parameters = [], $method = 'GET', array $settings = [])
{
if ($this->authorizationMode !== YamlConfiguration::OAUTH1_AUTHORIZATION_MODE && $method !== 'GET') {
$settings['headers']['Authorization'] = sprintf('Authorization: Bearer %s', $this->accesToken);
}

return $this->authorization->makeRequest($url, $parameters, $method, $settings);
}
}

0 comments on commit d1d69af

Please sign in to comment.