Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit f7ad879

Browse files
committed
:octocat: + Accept-Encoding: identity
1 parent 3b114ce commit f7ad879

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/Core/OAuth1Provider.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public function getRequestToken():AccessToken{
5656

5757
$request = $this->requestFactory
5858
->createRequest('POST', $this->requestTokenURL)
59-
->withHeader('Authorization', 'OAuth '.Psr7\build_http_query($params, true, ', ', '"'));
59+
->withHeader('Authorization', 'OAuth '.Psr7\build_http_query($params, true, ', ', '"'))
60+
->withHeader('Accept-Encoding', 'identity')
6061
;
6162

6263
foreach($this->authHeaders as $header => $value){
@@ -160,7 +161,9 @@ protected function getSignature(string $url, array $params, string $method, stri
160161
*/
161162
public function getAccessToken(string $token, string $verifier):AccessToken{
162163
$request = $this->requestFactory
163-
->createRequest('POST', Psr7\merge_query($this->accessTokenURL, ['oauth_verifier' => $verifier]));
164+
->createRequest('POST', Psr7\merge_query($this->accessTokenURL, ['oauth_verifier' => $verifier]))
165+
->withHeader('Accept-Encoding', 'identity')
166+
;
164167

165168
$request = $this->getRequestAuthorization($request, $this->storage->getAccessToken($this->serviceName));
166169

src/Core/OAuth2Provider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public function getAccessToken(string $code, string $state = null):AccessToken{
140140
$request = $this->requestFactory
141141
->createRequest('POST', $this->accessTokenURL)
142142
->withHeader('Content-Type', 'application/x-www-form-urlencoded')
143+
->withHeader('Accept-Encoding', 'identity')
143144
->withBody($this->streamFactory->createStream(http_build_query($body, '', '&', PHP_QUERY_RFC1738)));
144145

145146
foreach($this->authHeaders as $header => $value){

src/Core/OAuth2TokenRefreshTrait.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public function refreshAccessToken(AccessToken $token = null):AccessToken{
6060
$request = $this->requestFactory
6161
->createRequest('POST', $this->refreshTokenURL ?? $this->accessTokenURL)
6262
->withHeader('Content-Type', 'application/x-www-form-urlencoded')
63+
->withHeader('Accept-Encoding', 'identity')
6364
->withBody($this->streamFactory->createStream(http_build_query($body, '', '&', PHP_QUERY_RFC1738)))
6465
;
6566

0 commit comments

Comments
 (0)