jsDAV
jsDAV copied to clipboard
Delete locks on DELETE method
Windows sometimes does the following if you copy a file into a webdav directory:
- LOCK filename.txt -> 204 No content
- PUT filename.txt with 0 bytes using the lock-token -> 201 Created
- DELETE filename.txt using the lock-token -> 204 No content
- PUT filename.txt with content using NO lock-token -> 423 Locked
Of course this causes an error in Windows.
The RFC 4918 says at 9.6 about the DELETE method:
A server processing a successful DELETE request: MUST destroy locks rooted on the deleted resource
So windows behavior not using the lock-token at the last step is correct. JsDAV should delete locks on the DELETE method.
Agreed, this is a bug. I don't know when I'll have time to look into this... a code contribution would be very helpful/ faster here!
Thanks for the fast reply. I will make a suggestion.
(I'm online currently :smile:) I'd recommend looking at the 'afterDelete' event and hooking that up to the 'locks' plugin. To be super-thorough, the 'afterMove' event would also be interesting to update the lock.
Ok, perfect tipps to get startet :)
By the way: My first pull request :)
@mikedeboer is there a specific blocking reason to not merge https://github.com/mikedeboer/jsDAV/pull/152 ?