Skip to content

Commit

Permalink
Merge pull request #31 from 99designs/get-request-target
Browse files Browse the repository at this point in the history
SigningString: use getRequestTarget not getPath & getQuery.
  • Loading branch information
mtibben committed May 4, 2017
2 parents fd2d274 + 6d777cb commit 2d45a93
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/SigningString.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,7 @@ private function requestTargetLine()
return sprintf(
'(request-target): %s %s',
strtolower($this->message->getMethod()),
$this->getPathWithQueryString()
$this->message->getRequestTarget()
);
}

/**
* @return string
*/
private function getPathWithQueryString()
{
$path = $this->message->getUri()->getPath();
$qs = $this->message->getUri()->getQuery();
if (empty($qs)) {
return $path;
} else {
return "$path?$qs";
}
}
}

0 comments on commit 2d45a93

Please sign in to comment.