Skip to content

Commit

Permalink
api: apply mtime truncation in deletion logic alongside overwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
alonswartz committed Jan 6, 2025
1 parent ce5c68e commit 95a7406
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func apiNote(dir string, w http.ResponseWriter, r *http.Request, readOnly bool)
return
}

if !info.ModTime().UTC().Equal(noteDelete.LastMtime.UTC()) {
if !info.ModTime().Truncate(time.Second).UTC().Equal(noteDelete.LastMtime.Truncate(time.Second).UTC()) {
respondWithError(w, "Refusing to delete. File changed on disk.", http.StatusConflict)
return
}
Expand Down

0 comments on commit 95a7406

Please sign in to comment.