Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Common/Service/AbstractService.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ protected function determineRequestUriFromPath($path)
$path = substr($path, 1);
}

$uri->setPath($uri->getPath() . '/' . $path);
$uri->setPath(rtrim($uri->getPath(), '/') . '/' . $path);
}

return $uri;
Expand Down
21 changes: 21 additions & 0 deletions src/OAuth1/Service/FitBit.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,25 @@ protected function parseAccessTokenResponse($responseBody)

return $token;
}
/**
* Builds the authorization header array.
*
* @return array
*/
protected function getBasicAuthorizationHeaderInfo()
{
$dateTime = new \DateTime();
// Substracting 330 (5mins and 30s) seconds because sometimes execution is late
$timestamp = $dateTime->format('U') - 330;
$headerParameters = [
'oauth_callback' => $this->credentials->getCallbackUrl(),
'oauth_consumer_key' => $this->credentials->getConsumerId(),
'oauth_nonce' => $this->generateNonce(),
'oauth_signature_method' => $this->getSignatureMethod(),
'oauth_timestamp' => $timestamp,
'oauth_version' => $this->getVersion(),
];

return $headerParameters;
}
}
2 changes: 1 addition & 1 deletion tests/Unit/OAuth2/Service/DeviantArtTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function testBaseApiUriIsCorrect()
$service->expects($this->once())->method('httpRequest')->willReturnArgument(0);

$this->assertEquals(
'https://www.deviantart.com/api/v1/oauth2//api/method',
'https://www.deviantart.com/api/v1/oauth2/api/method',
(string) $service->request('/api/method')
);
}
Expand Down