http.ResponseWriter不设置标题内容类型

I wrote task from book The Go Programming Language by Brian W. Kernighan, Alan Donovan. It's task № 3.4 my handler of request look like this:

func handler(w http.ResponseWriter, r *http.Request) {
    poly(w)
    w.Header().Set("ContentType", "image/svg+xml")
    fmt.Println(w.Header().Get("ContentType"))
}

poly(w) - it's function that return svg file in Writer. Also, i cheked value of ContentType, and it's is "image/svg+xml". But when i look in develop menu in chrome(F12) i see this: network menu in debug

And, ofcourse, i see xml text of svn file, not a picture.

So, i have question: it's my mistake, or it's bug in golang, or it's normal sutiation.

You must set the headers before writing the response body. See the ResponseWriter documentation for more details.

Also, there's a typographical error. The header name is "Content-Type", not "ContentType"

func handler(w http.ResponseWriter, r *http.Request) {
  w.Header().Set("Content-Type", "image/svg+xml")
  poly(w)
}