Skip to content

Commit

Permalink
Stick to specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Edwin-Luijten committed Jul 23, 2016
1 parent 0772540 commit 8c7d5db
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions src/Provider/Strava.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@

use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Tool\BearerAuthorizationTrait;
use Psr\Http\Message\ResponseInterface;

class Strava extends AbstractProvider
{
use BearerAuthorizationTrait;

/**
* @var string
*/
Expand Down Expand Up @@ -118,27 +121,6 @@ protected function createResourceOwner(array $response, AccessToken $token)
return new StravaResourceOwner($response);
}

/**
* Returns the authorization headers used by this provider.
*
* Typically this is "Bearer" or "MAC". For more information see:
* http://tools.ietf.org/html/rfc6749#section-7.1
*
* No default is provided, providers must overload this method to activate
* authorization headers.
*
* @param mixed|null $token Either a string or an access token instance
* @return array
*/
protected function getAuthorizationHeaders($token = null)
{
return [

This comment has been minimized.

Copy link
@shadowhand

shadowhand Jul 23, 2016

You lost this header and the gzip header. I would recommend adding getDefaultHeaders if you want to keep them.

This comment has been minimized.

Copy link
@it-can

it-can Jul 25, 2016

Contributor

I added a PR, #4
is this correct @shadowhand ?

This comment has been minimized.

Copy link
@shadowhand

shadowhand Jul 28, 2016

Looks good!

'Accept' => 'application/json',
'Authorization' => 'Bearer ' . $token,
'Accept-Encoding' => 'gzip',
];
}

/**
* @return string
*/
Expand All @@ -154,5 +136,4 @@ public function getApiVersion()
{
return $this->apiVersion;
}

}

0 comments on commit 8c7d5db

Please sign in to comment.