-
Notifications
You must be signed in to change notification settings - Fork 18k
mime: wrong content-type return when use svg as css background-image #6378
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
Labels
Milestone
Comments
Comment 6 by germanium@gmx.us: I have the same issue on Linux. My distribution doesn't include a "mime.types" file therefore http.FileServer gives me a mime type of "text/xml; charset=utf-8" for .svg files. Firefox refuses to display .svg files in <img> tags unless the mime type is "image/svg+xml". I think it would be nice to have ".svg" in mime.mimeTypes if it is appropriate because it is useful to display static web pages correctly. Thanks, L |
You can add a mime.AddExtensionType(".svg", "image/svg+xml") line (and import "mime") and all is good. I had the same problem on Centos. But not because the mime file was missing, but because it expects to start with <!DOCTYPE svg and most .svg files start with <?xml version="1.0 ?><!DOCTYPE svg .... |
This issue seems to have already been fixed by commit 21e47d8 through CL https://go-review.googlesource.com/#/c/7942. The CL just hadn't mentioned it. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by ipv6.elata:
The text was updated successfully, but these errors were encountered: