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

JSON content beginning in low-ascii characters is no longer detected as application/json since 1.0.1 #239

Open
froodian opened this issue Jan 27, 2022 · 2 comments

Comments

@froodian
Copy link

Attach the file for which the detection is inaccurate
You can use the file sharing site of your choice, just ensure the file will not expire or get deleted.

{\n\t\t\"Hello\": \"World\"}

Expected MIME type

application/json

Returned MIME type

application/x-dbf

Version of the library you are using

This reproduces starting in 1.0.1 and in any version since - it was introduced by 798d7a4 - specifically due to txt being renamed to utf8 and moved to lowest priority

Output of go version

go version go1.17.2 darwin/amd64

@gabriel-vasile
Copy link
Owner

#241 should fix this.

You can test it with:

go get github.com/gabriel-vasile/mimetype@272584c8

Let me know if there's still an issue.

@froodian
Copy link
Author

froodian commented Mar 4, 2022

Hi @gabriel-vasile - thanks for the fast fix and sorry for the delay - our tests are all passing with that patch so as far as I can see the issue appears fixed, thank you

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

No branches or pull requests

2 participants