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 for text (issue: #88) #89

Closed
wants to merge 3 commits into from

Conversation

sshota0809
Copy link

@sshota0809 sshota0809 commented Jul 4, 2020

this is related to issue #88

I tried to add MIME type for text.

Following main.go is to Match sample.html

$ od -N14 -hc sample.html 
0000000      213c    6f64    7463    7079    2065    7468    6c6d        
           <   !   d   o   c   t   y   p   e       h   t   m   l        
0000016

$ go run main.go 
File type: html. MIME: application/html

Please review my code and consider to merge my this.

Best regards.

@sshota0809 sshota0809 changed the title add MIME type for text (issue: #88) Add MIME type for text (issue: #88) Jul 4, 2020
@h2non
Copy link
Owner

h2non commented Jul 4, 2020

This library is not intended to work with text-based files with arbitrary content within that might or might not be compliment with a specific content format. It's only intended to work with binary files that expose a deterministic magic number bytes header within them.

For text-based inference format, a different matching strategy should be used, as done here:
https://github.com/h2non/go-is-svg

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.

None yet

3 participants