mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-19 04:24:28 +02:00
simpler logic
related to https://github.com/chrislusf/seaweedfs/pull/1981
This commit is contained in:
1 parent
52200a903b
commit
1e033d45b8
1 file changed
+1
-1
@@ -79,7 +79,7 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,
|
||||
w.Header().Set("Last-Modified", entry.Attr.Mtime.UTC().Format(http.TimeFormat))
|
||||
if r.Header.Get("If-Modified-Since") != "" {
|
||||
if t, parseError := time.Parse(http.TimeFormat, r.Header.Get("If-Modified-Since")); parseError == nil {
|
||||
if t.After(entry.Attr.Mtime) || t.Equal(entry.Attr.Mtime) {
|
||||
if !t.Before(entry.Attr.Mtime) {
|
||||
w.WriteHeader(http.StatusNotModified)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user