dynamically present content type

This commit is contained in:
Antoni Sawicki 2024-07-02 02:32:59 -07:00
parent 91870f5724
commit 0e3192b69f

2
txt.go
View File

@ -169,7 +169,7 @@ func imgServerZ(w http.ResponseWriter, r *http.Request) {
return
}
imgStor.del(id)
w.Header().Set("Content-Type", "image/gif")
w.Header().Set("Content-Type", http.DetectContentType(img))
w.Header().Set("Content-Length", strconv.Itoa(len(img)))
w.Write(img)
w.(http.Flusher).Flush()