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

Commit 4970ad1

Browse files
committedMar 1, 2019
:octocat: more precise
1 parent 02afac3 commit 4970ad1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/Core/OAuthProvider.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ public function request(string $path, array $params = null, string $method = nul
293293
if(is_array($body) && $request->hasHeader('content-type')){
294294
$contentType = strtolower($request->getHeaderLine('content-type'));
295295

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

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

327328
// attempt to refresh an expired token

0 commit comments

Comments
 (0)