-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
s3.WithPresignExpires introduces additional http header #2749
Comments
Hi @qsun0621, I'm not seeing the extra header being added: input := &s3.GetObjectInput{
Bucket: aws.String("testbucket-REDACTED"),
Key: aws.String("foo.txt"),
}
signedRequest, err := presigner.PresignGetObject(context.TODO(), input, func(options *s3.PresignOptions) {
options.Expires = 35 * time.Minute
}) Results in:
And with input := &s3.GetObjectInput{
Bucket: aws.String("testbucket-REDACTED"),
Key: aws.String("foo.txt"),
}
signedRequest, err := presigner.PresignGetObject(context.TODO(), input, s3.WithPresignExpires(35*time.Minute)) Results in:
As you can see the presigned request is being generated with the exact same parameters.
This would not be the case unless Can you please include a complete code snippet of how you are generating and using the presigned URL? Thanks, |
Probably a duplicate of #2531
|
This issue is now closed. Comments on closed issues are hard for our team to see. |
Acknowledgements
go get -u github.com/aws/aws-sdk-go-v2/...
)Describe the bug
When we call func "PresignGetObject" to generate a presigned URL, we need to provide the expiration time.
The presigned URL can be used directly when we specific the expiration time using
However when we use s3.WithPresignExpires() func, it introduced another header
"Amz-Sdk-Request":["attempt=1; max=3"]
in the presigned HTTP request, which makes the direct GET on the URL without header always returning a signature not match error.Expected Behavior
s3.WithPresignExpires() does not add the additional retry header
Current Behavior
s3.WithPresignExpires() adds the additional retry header
Reproduction Steps
PresignGetObject(ctx, &s3.GetObjectInput{
Bucket: aws.String(bucket),
Key: aws.String(key),
}, s3.WithPresignExpires(expiresIn))
Possible Solution
No response
Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
v1.30.3
Compiler and Version used
go1.22.5 darwin/arm64
Operating System and version
Sonoma 14.6.1
The text was updated successfully, but these errors were encountered: