Pre-signed GetObject requests with Range header throws SignatureDoesNotMatch exception #4823
Labels
response-requested
Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Describe the bug
We've uploaded some large files to AWS and are trying to build a "preview" feature which will only show the first 1MB of the already uploaded file.
The AWS documentation suggests the Range header, but when that param is added a SignatureDoesNotMatch error is thrown.
Expected Behavior
I expected to get back the first 1Mb of the uploaded file.
Current Behavior
SignatureDoesNotMatch error is thrown.
Reproduction Steps
const client = new S3({region}); const command = new GetObjectCommand({ Bucket: bucket, Key: key, Range: "bytes=0-10000", }); const url = await getSignedUrl(client, command, { expiresIn: 3600 });
Code works as expected without the Range param.
Possible Solution
No response
Additional Information/Context
No response
SDK version used
3.209
Environment details (OS name and version, etc.)
Mac OS Ventura 13.4
The text was updated successfully, but these errors were encountered: