0
Fork 0
mirror of https://github.com/willnorris/imageproxy.git synced 2024-12-16 21:56:43 -05:00

copy original content-type from remote response

This commit is contained in:
Will Norris 2015-02-20 13:05:31 -08:00
parent 15eb6b6da6
commit bf8d7a0cd8

View file

@ -119,6 +119,7 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
} }
w.Header().Add("Content-Length", resp.Header.Get("Content-Length")) w.Header().Add("Content-Length", resp.Header.Get("Content-Length"))
w.Header().Add("Content-Type", resp.Header.Get("Content-Type"))
defer resp.Body.Close() defer resp.Body.Close()
io.Copy(w, resp.Body) io.Copy(w, resp.Body)
} }