Skip to content

Commit

Permalink
issue #535 Honor the key_prefix when making requests using cloudfront.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmadden committed Jan 30, 2023
1 parent 0b52885 commit d2633f5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion classes/local/store/s3/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,13 @@ private function generate_presigned_url_cloudfront($contenthash, array $headers
$key .= '';
}
}
$resource = $this->config->cloudfrontresourcedomain . '/' . $key;

if (!empty($this->bucketkeyprefix)) {
$resource = $this->config->cloudfrontresourcedomain . '/' . $this->bucketkeyprefix . $key;
} else {
$resource = $this->config->cloudfrontresourcedomain . '/' . $key;
}

// This is the id of the Cloudfront key pair you generated.
$keypairid = $this->config->cloudfrontkeypairid;

Expand Down

0 comments on commit d2633f5

Please sign in to comment.