fix: content-type conflicts with #5420

This commit is contained in:
Andy Hsu 2023-11-24 19:22:19 +08:00
parent 3f405de6a9
commit d26887d211

View File

@ -19,7 +19,7 @@ func Proxy(w http.ResponseWriter, r *http.Request, link *model.Link, file model.
attachFileName(w, file)
contentType := link.Header.Get("Content-Type")
if contentType != "" {
w.Header().Add("Content-Type", contentType)
w.Header().Set("Content-Type", contentType)
}
http.ServeContent(w, r, file.GetName(), file.ModTime(), link.MFile)
return nil