You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UTF-8 BOMs are unnecessary and often cause pain for little to no benefit. You should avoid them.
http.DetectContentType implements https://mimesniff.spec.whatwg.org/ which does not seem to suggest that any textual content type can have a UTF-8 BOM in front of it.
So it looks like this is working as intended.
Let me know if I misread the mimesniff spec, though.
Uh oh!
There was an error while loading. Please reload this page.
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?What did you do?
Run this code, which is on the playground:
What did you expect to see?
What did you see instead?
It seems from sniff.go that a BOM automatically triggers a text/plain MIME type. Ideally,
htmlSig
would detect UTF-8 BOMs and skip past them.The text was updated successfully, but these errors were encountered: