-
Notifications
You must be signed in to change notification settings - Fork 46
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
support for sniffing image SVG #7
Comments
I think we would rather not add sniffing for XML. The way SVG images work is by properly labeling them as |
the "bug" doesn't ask for sniffing in general, it asks for sniffing at file upload, where you might pay attention to the .svg file extension too. |
@annevk alright. I could look at the way
@masinter actually that ability is used in net/http/sniff DetectContentType and its purpose is to determine the content-Type from sniffing 512 bytes of data. It used in servers internally when serving back content, sniff the type and appropriately set the "Content-Type" header if not already set in the response. The data served back usually won't have an extension since it is just an http response payload. I happen to be the last person that touched that code and would like to see if we could support it. |
Is file extension the only way to determine a MIME type when uploading or some such? What do browsers do there today? |
See also w3c/FileAPI#51. |
I'm closing this. That File API issue is the place to standardize local file system mappings. And we don't want to introduce more sniffing for this case. Please label the SVG resources instead somehow. |
To not close the door here entirely I filed #51 to sort out the exact scope of this document as there seems to be some tension between the requirements of Go and that of a browser. It would be good to resolve such conflicts or at least clearly document them. |
This is a nuisance problem when serving SVG images via a Go http server, the mime type has to be adjusted to image/svg+xml manually or the image won't display. |
I kindly would like to ask if it is possible for us to add support for sniffing SVG images. If the signature is added here, it will allow adding the signature to the Go standard library and potentially other consumers that depend on the standards here. My motivation is to solve this issue golang/go#15888, if the signature is present.
Currently the *NIX utility
file
supports it and I can even copy just 512 bytes of an SVG file where the original is https://upload.wikimedia.org/wikipedia/commons/f/f1/Android_sample.svgPlease let me know how I can be of help in getting this solved.
Thank you.
The text was updated successfully, but these errors were encountered: