diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-03-07 06:07:25 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-03-07 06:08:08 -0800 |
| commit | dba35404e4951a2c428acd139d015b08de7ffd19 (patch) | |
| tree | be22bc1aaf4d901a082b48b105021becbdf90154 | |
| parent | ea1169dc8021172a5d14e618b041efb56db98de5 (diff) | |
| download | seaweedfs-dba35404e4951a2c428acd139d015b08de7ffd19.tar.xz seaweedfs-dba35404e4951a2c428acd139d015b08de7ffd19.zip | |
filer: HEAD response add content type
| -rw-r--r-- | weed/server/filer_server_handlers_read.go | 3 |
1 files changed, 3 insertions, 0 deletions
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 } |
