Skip to content

Commit

Permalink
Pass the same uri object url to the policy creation
Browse files Browse the repository at this point in the history
  • Loading branch information
gator92 committed Jun 16, 2015
1 parent c080539 commit e6fb8bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CloudFront/UrlSigner.php
Expand Up @@ -69,16 +69,16 @@ public function getSignedUrl($url, $expires = null, $policy = null)

// Get the real scheme by removing wildcards from the scheme
$scheme = str_replace('*', '', $urlSections[0]);
$uri = new Uri($scheme . '://' . $urlSections[1]);

if ($policy) {
$isCustom = true;
} else {
$isCustom = false;
$policy = $this->createCannedPolicy($scheme, $url, $expires);
$policy = $this->createCannedPolicy($scheme, $uri->__toString(), $expires);
}

$policy = str_replace(' ', '', $policy);
$uri = new Uri($scheme . '://' . $urlSections[1]);
parse_str($uri->getQuery(), $query);
$query = $this->prepareQuery($isCustom, $policy, $query, $expires);
$uri = $uri->withQuery(http_build_query($query, null, '&', PHP_QUERY_RFC3986));
Expand Down

0 comments on commit e6fb8bb

Please sign in to comment.