Skip to content

Commit 04c3aeb

Browse files
committed
issue #535 Honor the key_prefix when making requests using cloudfront.
1 parent 4c24a1a commit 04c3aeb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

classes/local/store/s3/client.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,13 @@ private function generate_presigned_url_cloudfront($contenthash, array $headers
543543
$key .= '';
544544
}
545545
}
546-
$resource = $this->config->cloudfrontresourcedomain . '/' . $key;
546+
547+
if (!empty($this->bucketkeyprefix)) {
548+
$resource = $this->config->cloudfrontresourcedomain . '/' . $this->bucketkeyprefix . $key;
549+
} else {
550+
$resource = $this->config->cloudfrontresourcedomain . '/' . $key;
551+
}
552+
547553
// This is the id of the Cloudfront key pair you generated.
548554
$keypairid = $this->config->cloudfrontkeypairid;
549555

0 commit comments

Comments
 (0)