From 4970ad1e9d66a6d3423bdee8ef021745e922df78 Mon Sep 17 00:00:00 2001 From: codemasher Date: Fri, 1 Mar 2019 20:05:34 +0100 Subject: [PATCH] :octocat: more precise --- src/Core/OAuthProvider.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Core/OAuthProvider.php b/src/Core/OAuthProvider.php index 3d4f11e9..c4555e56 100644 --- a/src/Core/OAuthProvider.php +++ b/src/Core/OAuthProvider.php @@ -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)); } @@ -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