mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-15 16:14:56 +08:00
1. ensure replicated file has the same timestamp
2. upload can specify modified time by &ts=... 3. correctly return code 304
This commit is contained in:
@@ -149,7 +149,7 @@ func GetOrHeadHandler(w http.ResponseWriter, r *http.Request, isGetMethod bool)
|
||||
w.Header().Set("Last-Modified", time.Unix(int64(n.LastModified), 0).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.Unix() <= int64(n.LastModified) {
|
||||
if t.Unix() >= int64(n.LastModified) {
|
||||
w.WriteHeader(http.StatusNotModified)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user