Do not include Content-Type to presigned URL #505

Open
opened 2024-09-30 10:54:19 +00:00 by alexvanin · 0 comments
Owner

S3 Authmate allows to generate presign URL even for object upload. However, it uses hardcoded Content-Type header in a signature.

req.Header.Set(ContentTypeHdr, "text/plain")

This header is not usable for all cases, so consider change it.

Describe the solution you'd like

As simple solution Content-Type can be dropped from signature at all, so HTTP client can set any value and get correct output.

Describe alternatives you've considered

Provide an option to configure Content-Type header value the same way as Authmate allows to configure lifetime.

Additional context

Also it would be nice to have an example of a curl command to upload file with presigned URL.

## Is your feature request related to a problem? Please describe. S3 Authmate allows to generate presign URL even for object upload. However, it uses hardcoded `Content-Type` header in a signature. https://git.frostfs.info/TrueCloudLab/frostfs-s3-gw/src/commit/6b109eee92e8b7bb00d9071de8d91939a39b609e/api/auth/presign.go#L37 This header is not usable for all cases, so consider change it. ## Describe the solution you'd like As simple solution `Content-Type` can be dropped from signature at all, so HTTP client can set any value and get correct output. ## Describe alternatives you've considered Provide an option to configure `Content-Type` header value the same way as Authmate allows to configure lifetime. ## Additional context Also it would be nice to have an example of a `curl` command to upload file with presigned URL.
alexvanin changed title from Do not include content-type to presigned URL to Do not include Content-Type to presigned URL 2024-09-30 10:54:26 +00:00
alexvanin added the
good first issue
label 2024-09-30 10:54:31 +00:00
alexvanin added this to the v0.32.0 milestone 2024-09-30 10:54:46 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-s3-gw#505
No description provided.