diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-02-23 12:25:27 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-02-23 12:25:27 -0800 |
| commit | 7ba75e3d5a4b059f4b41797f96a0feea97eef66a (patch) | |
| tree | 595a6605cc11fc52427e9a0c4d587e48ce076f8c | |
| parent | 9edd964627a1d0eb6549ab4eaab8e0191551c70a (diff) | |
| download | seaweedfs-7ba75e3d5a4b059f4b41797f96a0feea97eef66a.tar.xz seaweedfs-7ba75e3d5a4b059f4b41797f96a0feea97eef66a.zip | |
filer: do not return no content for empty files
fix https://github.com/chrislusf/seaweedfs/issues/1831
fix https://github.com/chrislusf/seaweedfs/issues/1830
| -rw-r--r-- | weed/server/filer_server_handlers_read.go | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/weed/server/filer_server_handlers_read.go b/weed/server/filer_server_handlers_read.go index f77462adb..160ee9d97 100644 --- a/weed/server/filer_server_handlers_read.go +++ b/weed/server/filer_server_handlers_read.go @@ -61,15 +61,7 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request, return } - if len(entry.Chunks) == 0 && len(entry.Content) == 0 { - glog.V(1).Infof("no file chunks for %s, attr=%+v", path, entry.Attr) - stats.FilerRequestCounter.WithLabelValues("read.nocontent").Inc() - w.WriteHeader(http.StatusNoContent) - return - } - w.Header().Set("Accept-Ranges", "bytes") - w.Header().Set("Last-Modified", entry.Attr.Mtime.Format(http.TimeFormat)) // mime type mimeType := entry.Attr.Mime |
