From dba35404e4951a2c428acd139d015b08de7ffd19 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 7 Mar 2020 06:07:25 -0800 Subject: [PATCH] filer: HEAD response add content type --- weed/server/filer_server_handlers_read.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weed/server/filer_server_handlers_read.go b/weed/server/filer_server_handlers_read.go index 796fd9c1c..ca687ca5d 100644 --- a/weed/server/filer_server_handlers_read.go +++ b/weed/server/filer_server_handlers_read.go @@ -70,6 +70,9 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request, if r.Method == "HEAD" { w.Header().Set("Content-Length", strconv.FormatInt(int64(filer2.TotalSize(entry.Chunks)), 10)) w.Header().Set("Last-Modified", entry.Attr.Mtime.Format(http.TimeFormat)) + if entry.Attr.Mime != "" { + w.Header().Set("Content-Type", entry.Attr.Mime) + } setEtag(w, filer2.ETag(entry.Chunks)) return }