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

Fixes #7252 - Uses gabriel-vasile/mimetype to support additional content types #7262

Merged
merged 5 commits into from May 4, 2020
Merged

Fixes #7252 - Uses gabriel-vasile/mimetype to support additional content types #7262

merged 5 commits into from May 4, 2020

Conversation

gowthamgts
Copy link
Contributor

@gowthamgts gowthamgts commented May 1, 2020

This fixes #7252 by replacing http.DetectContentType() with mimetype.Detect() from https://github.com/gabriel-vasile/mimetype library.

I've tested locally with the ODS files, mp3 files and html files. Please let me know if there's anything further that needs to be done!

@auto-comment

This comment has been minimized.

core/corehttp/gateway_handler.go Outdated Show resolved Hide resolved
@gowthamgts gowthamgts requested a review from hsanjuan May 1, 2020 15:02
Copy link
Contributor

@hsanjuan hsanjuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick and LGTM

core/corehttp/gateway_handler.go Outdated Show resolved Hide resolved
@gowthamgts gowthamgts requested a review from hsanjuan May 1, 2020 17:08
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM. I've been fuzzing this library for a while and haven't found any crashes so this seems good to go.

core/corehttp/gateway_handler.go Outdated Show resolved Hide resolved
@gowthamgts gowthamgts requested a review from Stebalien May 2, 2020 08:54
@Stebalien Stebalien merged commit 01e27f9 into ipfs:master May 4, 2020
@Stebalien
Copy link
Member

Hm. Apparently I didn't push my rebase to the right origin...

@Stebalien
Copy link
Member

@gowthamgts thanks for the fix!

@gowthamgts gowthamgts deleted the fix/http/content-type branch May 4, 2020 06:16
@Stebalien Stebalien mentioned this pull request May 26, 2020
77 tasks
hacdias pushed a commit to ipfs/boxo that referenced this pull request Jan 27, 2023
Fixes #7252 - Uses gabriel-vasile/mimetype to support additional content types

This commit was moved from ipfs/kubo@01e27f9
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.

Gateway content type detection : ODS documents served as ZIP (MIME)
3 participants