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

Commit

Permalink
:octocat: more precise
Browse files Browse the repository at this point in the history
  • Loading branch information
codemasher committed Mar 1, 2019
1 parent 02afac3 commit 4970ad1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Core/OAuthProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ public function request(string $path, array $params = null, string $method = nul
if(is_array($body) && $request->hasHeader('content-type')){
$contentType = strtolower($request->getHeaderLine('content-type'));

// @todo: content type support
if($contentType === 'application/x-www-form-urlencoded'){
$body = $this->streamFactory->createStream(http_build_query($body, '', '&', PHP_QUERY_RFC1738));
}
Expand Down Expand Up @@ -321,7 +322,7 @@ public function request(string $path, array $params = null, string $method = nul
public function sendRequest(RequestInterface $request):ResponseInterface{

// get authorization only if we request the provider API
if($request->getUri()->getHost() === parse_url($this->apiURL, PHP_URL_HOST)){
if(strpos((string)$request->getUri(), $this->apiURL) === 0){
$token = $this->storage->getAccessToken($this->serviceName);

// attempt to refresh an expired token
Expand Down

0 comments on commit 4970ad1

Please sign in to comment.