* Akeeba Engine
*
* @package akeebaengine
- * @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd
+ * @copyright Copyright (c)2006-2024 Nicholas K. Dionysopoulos / Akeeba Ltd
* @license GNU General Public License version 3, or later
*/
$search = '/' . $bucket;
- if (strpos($uri, $search) === 0)
- {
- $uri = substr($uri, strlen($search));
- }
+ // This does not look right... The bucket name must be included in the URL.
+// if (strpos($uri, $search) === 0)
+// {
+// $uri = substr($uri, strlen($search));
+// }
$queryParameters = array_merge($this->request->getParameters(), [
'AWSAccessKeyId' => $accessKey,
// See http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html#RESTAuthenticationQueryStringAuth
if (isset($headers['Expires']))
{
- $headers['Date'] = $headers['Expires'];
+ if (isset($headers['Date']))
+ {
+ $headers['Date'] = $headers['Expires'];
+ }
+ else
+ {
+ $amzHeaders['x-amz-date'] = $headers['Expires'];
+ }
+
unset ($headers['Expires']);
$isPresignedURL = true;
$stringToSign = $verb . "\n" .
($headers['Content-MD5'] ?? '') . "\n" .
($headers['Content-Type'] ?? '') . "\n" .
- $headers['Date'] .
+ ($headers['Date'] ?? '') .
$amzString . "\n" .
$resourcePath;
// CloudFront only requires a date to be signed
if ($headers['Host'] == 'cloudfront.amazonaws.com')
{
- $stringToSign = $headers['Date'];
+ $stringToSign = $headers['Date'] ?? $amzHeaders['x-amz-date'] ?? '';
}
$amazonV2Hash = $this->amazonV2Hash($stringToSign);