Skip to content
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

[feature] Save media to bucket with correct Content-type #3350

Closed
prplecake opened this issue Sep 24, 2024 · 2 comments · Fixed by #3353
Closed

[feature] Save media to bucket with correct Content-type #3350

prplecake opened this issue Sep 24, 2024 · 2 comments · Fixed by #3353
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@prplecake
Copy link

prplecake commented Sep 24, 2024

Is your feature request related to a problem ?

It appears that media uploaded to S3-compatible buckets all get uploaded with a content-type: application/octet-stream. So using the new CDN redirect URL setting (#2574), attempting to view images via the CDN causes the browser to download the file instead of displaying the image.

The presigned URLs correctly accounted for content-type, but those aren't used when using the CDN redirect.

Describe the solution you'd like.

Files should be saved to the bucket with a proper content-type if we can detect it.

Describe alternatives you've considered.

Using edge rules to set the content-type header based on file extension. This doesn't seem like the correct place to do this.

Additional context.

Serving the images inline works fine, this is only a problem when "Opening image in new tab" or otherwise directly accessing the image URL.

@prplecake prplecake added the enhancement New feature or request label Sep 24, 2024
@tsmethurst
Copy link
Contributor

Thanks for this! This is really a bug imo, we should be using the correct content type when uploading, so I'll see if we can fix this for 0.17.0 :)

@tsmethurst tsmethurst added this to the v0.17.0 milestone Sep 25, 2024
@tsmethurst tsmethurst self-assigned this Sep 25, 2024
@NyaaaWhatsUpDoc
Copy link
Member

i think this might be one that i need to handle @tsmethurst, i have a feeling it'll be something in the go-storage library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants