diff --git a/storage/filesystem.go b/storage/filesystem.go index 04e383d..ce9f00b 100644 --- a/storage/filesystem.go +++ b/storage/filesystem.go @@ -425,7 +425,8 @@ func (b *filesystemBackend) PutAddressObject(ctx context.Context, objPath string return "", err } - if _, err := os.Stat(localPath); !os.IsNotExist(err) { + // TODO handle IfMatch + if _, err := os.Stat(localPath); !os.IsNotExist(err) && opts.IfNoneMatch { return "", carddav.NewPreconditionError(carddav.PreconditionNoUIDConflict) } @@ -603,7 +604,8 @@ func (b *filesystemBackend) PutCalendarObject(ctx context.Context, objPath strin return "", err } - if _, err := os.Stat(localPath); !os.IsNotExist(err) { + // TODO handle IfMatch + if _, err := os.Stat(localPath); !os.IsNotExist(err) && opts.IfNoneMatch { return "", caldav.NewPreconditionError(caldav.PreconditionNoUIDConflict) }