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

Add mime type to google-storage-proxy to support http responses #8

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

knjoroge
Copy link
Contributor

@knjoroge knjoroge commented Nov 15, 2024

This pull request adds MIME type support to the HTTP responses for the google-storage-proxy by setting the Content-Type header based on the file's MIME type. This improves content rending.

@fkorotkov @edigaryev Thank you for reviewing this pull request!

Changes

  • Implemented MIME type detection using the mime package in Go. The MIME type is determined based on the file extension.

  • Added logic to set the Content-Type header in HTTP responses within the downloadBlob function.

  • If the MIME type cannot be determined, it defaults to application/octet-stream.

Testing

Before:
Screenshot 2024-11-15 at 16 47 28

image

After:
Screenshot 2024-11-15 at 16 51 45

Screenshot 2024-11-15 at 17 06 30

@fkorotkov fkorotkov merged commit 122385f into cirruslabs:master Nov 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants