How to remove X-Amz-Content-Sha256=UNSIGNED-PAYLOAD #2272
-
Hi Is there any way to remove X-Amz-Content-Sha256=UNSIGNED-PAYLOAD while generating presigned url using php. Below is the script. My Target S3 not support header X-Amz-Content-Sha256=UNSIGNED-PAYLOAD and produce error "A header you provided implies functionality that is not implemented." "latest", "region" => "us-east-1", "signature_version" => "v4", "endpoint" => $endpoint, "use_path_style_endpoint" => true, "credentials" => [ "key" => "xx", "secret" => "xx", ], ]); $key = "image.jpeg"; ## update // Get a command object from the client $command = $s3->getCommand('GetObject', [ 'Bucket' => $bucket, 'Key' => $key ]); // Create a pre-signed URL for a request with duration of 10 miniutes $request = $s3->createPresignedRequest($command, '+10 minutes'); $presignedRequest = $s3->createPresignedRequest($command, '+10 minutes'); // Get the actual presigned-url $presignedUrl = (string) $presignedRequest->getUri(); var_dump($presignedUrl); |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Solved. by edit S3SignatureV4.php and remove/comment this line // $request = $request->withHeader( |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Solved. by edit S3SignatureV4.php
and remove/comment this line
// $request = $request->withHeader(
// 'X-Amz-Content-Sha256',
// $this->getPresignedPayload($request)
// );