mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
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
This commit is contained in:
parent
9edd964627
commit
7ba75e3d5a
|
@ -61,15 +61,7 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,
|
||||||
return
|
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("Accept-Ranges", "bytes")
|
||||||
w.Header().Set("Last-Modified", entry.Attr.Mtime.Format(http.TimeFormat))
|
|
||||||
|
|
||||||
// mime type
|
// mime type
|
||||||
mimeType := entry.Attr.Mime
|
mimeType := entry.Attr.Mime
|
||||||
|
|
Loading…
Reference in a new issue