Skip to content

net/http: DetectContextType: recognize svg file as image/svg+xml #15888

Closed
@tnclong

Description

@tnclong

What version of Go are you using (go version)?

go version go1.6.2 darwin/amd64

What did you do?
I want to upload svg file to aws s3. I use http.DetectContentType(buffer) to get the content type.
I really want the http.DetectContentType(buffer); back image/svg+xml replace text/xml; charset=utf-8. Because the browser don't show the svg images when <img src="s3/a-svg-file.svg"> if you give browser ContentType: text/xml; charset=utf-8.
I think it's more suit for web develop.

What did you expect to see?
image/svg+xml

If the function out of http.DetectContentType(buffer) scope or you have suggestions for me. Welcome to reply.
Thank you very much and sorry for my bad English.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions