dav
dav copied to clipboard
`NOT` in If is not always correctly evaluated.
This causes a litmus test to fail. See #702 for lots of detail.
The gist of it is this:
(Not <DAV:no-lock> ["c3d40b11121145ec31f5c1acc078b658"])
Should be interepreted as:
(Not <DAV:no-lock>) AND (["c3d40b11121145ec31f5c1acc078b658"])
Currently it is interpreted as:
Not (<DAV:no-lock> AND ["c3d40b11121145ec31f5c1acc078b658"])
The NOT can actually appear both in front of the lock token and the etag. Our data-structure assumes one NOT that appears in front of both. This needs to be tweaked and might be a breaking change.
Sabre\DAV\Server::getIfConditions() implementation is very simple. It won't handle properly also (Not ["etag1"] Not ["etag2"]), nor (["tag1"] Not <opaquetoken:test>), nor anything with more than two conditions.
Spec: https://datatracker.ietf.org/doc/html/rfc4918#section-10.4.2