Replies: 4 comments
-
Hi @xuanyu66, Thanks for reaching out. There is a distinction between the For example, using the functional options will result in an presignObject, err := presigner.PresignPutObject(context.TODO(), &s3.PutObjectInput{
Bucket: aws.String("testbucket"),
Key: aws.String("sample.txt"),
Body: data,
}, func(options *s3.PresignOptions) {
options.Expires = 30 * time.Minute
})
When you set the presignObject, err := presigner.PresignPutObject(context.TODO(), &s3.PutObjectInput{
Bucket: aws.String("testbucket"),
Key: aws.String("sample.txt"),
Body: data,
Expires: aws.Time(time.Now().Add(30 * time.Minute)),
}, func(options *s3.PresignOptions) {
options.Expires = 30 * time.Minute
})
In the latter generated presigned URL you can see that Thanks, |
Beta Was this translation helpful? Give feedback.
-
So, I need to add a header such as "Expires: Sat, 27 Jun 2015 23:59:59 GMT"? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
@xuanyu66 The return of the This is not at all ideal, but is a necessity with S3 due to it not fully supporting query hoisting across various request parameters. We maintain a list of these inputs internally that we know (or knew in the past) to not work in the query, |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
When generating a presigned URL with PresignPutObject and setting the Expires field, attempting to put an object to S3 returns the error "SignatureDoesNotMatch". However, without setting the Expires field, it works fine.
Expected Behavior
return 200
Current Behavior
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
Compiler and Version used
go version go1.21.3 darwin/arm64
Operating System and version
macOS Ventura 13.6.4
Beta Was this translation helpful? Give feedback.
All reactions