aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMerlin Gaillard <merlin@gaillard.pl>2021-04-09 15:04:17 +0200
committerMerlin Gaillard <merlin@gaillard.pl>2021-04-09 15:04:17 +0200
commitf952f979d1cc6a0975d73491d7e6aa5c4e1b522c (patch)
treec344e6eb47d6c12914c67b82931c18f888b777ed
parent4d4acc715e517ae8f7cdaed220908dbd8e0b7773 (diff)
downloadseaweedfs-f952f979d1cc6a0975d73491d7e6aa5c4e1b522c.tar.xz
seaweedfs-f952f979d1cc6a0975d73491d7e6aa5c4e1b522c.zip
filer: return 304 when If-Modified-Since == Last-Modified
-rw-r--r--weed/server/filer_server_handlers_read.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/weed/server/filer_server_handlers_read.go b/weed/server/filer_server_handlers_read.go
index f90b070a2..cdfdf9b49 100644
--- a/weed/server/filer_server_handlers_read.go
+++ b/weed/server/filer_server_handlers_read.go
@@ -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) {
+ if t.After(entry.Attr.Mtime) || t.Equal(entry.Attr.Mtime) {
w.WriteHeader(http.StatusNotModified)
return
}