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
net/http: ServeContent / FileServer mime issue #9156
Labels
Milestone
Comments
Go does set: ".css": "text/css; charset=utf-8", But I think it prefers what Windows says. If you want "text/css; charset=utf-8", best is to set it explicitly. I don't think we can make any change safely here (without breaking backwards compatibility with current behavior), even if we wanted to. Some people might be relying on their operating system's selection of mime type the Go-known file extensions. Status changed to WorkingAsIntended. |
Comment 5 by neven.jacmenovic: Hi Brad, Thank you very much for detailed explanation, and yes you are 100% correct - my old Vista machine has text/plain for HKEY_CLASSES_ROOT\.css I was mistakenly lead to believe that "HKEY_CLASSES_ROOT\Mime\Database\Content Type" holds correct server side mime types (there is text/css definition for .css), and HKEY_CLASSES_ROOT just client side (eg what happens when user double clicks .css file in windows explorer) but since this is Windows, nothing can surprise me anymore. For further reference in case somebody stumbles on the same issue, this blog post explains windows mime mayhem the best: http://codelog.climens.net/2009/10/28/getting-mime-type-in-net-from-file-extension/ Best regards Neven |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by neven.jacmenovic:
The text was updated successfully, but these errors were encountered: