amazon-s3-php-class icon indicating copy to clipboard operation
amazon-s3-php-class copied to clipboard

getAuthenticatedURL::1173 bucket error

Open thefrosty opened this issue 9 years ago • 3 comments

Not sure if this is an error or just an issue when I am using it. But your commented out line at 1173 works without issue, but the following line (that assume replaced it) with $endpoint/$bucket fails for me. Is there a reason for this line? Is there something I am doing wrong?

Works (commented out code): mybucket.s3.amazonaws.com/file.mp4

Current code outputs (which fails): mybucket/file.mp4 OR mybucket.s3.amazonaws.com/mybucket/file.mp4

thefrosty avatar Mar 24 '15 21:03 thefrosty

Yes, I can confirm that commented line `1184´ works correctly, while the newer one doesn't work.

This works

$hostBucket ? $bucket : $bucket.'.s3.amazonaws.com', $uri, self::$__accessKey, $expires

This doesn't

$hostBucket ? $bucket : self::$endpoint.'/'.$bucket, $uri, self::$__accessKey, $expires

Forcing $hostBucket to true when calling the function generates an invalid signature.

robertotremonti avatar Jun 23 '15 10:06 robertotremonti

Just to confirm that I've found exactly the same. Only works with the commented line.

rsmck avatar Aug 27 '15 11:08 rsmck

Just chiming in to say this is the same for me in 2022. the commented out line works perfect, the line that replaces in does not work as the signature does not match the URL

mike16889 avatar Jan 18 '22 22:01 mike16889