jsDAV icon indicating copy to clipboard operation
jsDAV copied to clipboard

Delete locks on DELETE method

Open angermueller opened this issue 8 years ago • 6 comments

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.

angermueller avatar Aug 13 '16 10:08 angermueller

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!

mikedeboer avatar Aug 13 '16 10:08 mikedeboer

Thanks for the fast reply. I will make a suggestion.

angermueller avatar Aug 13 '16 10:08 angermueller

(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.

mikedeboer avatar Aug 13 '16 10:08 mikedeboer

Ok, perfect tipps to get startet :)

angermueller avatar Aug 13 '16 11:08 angermueller

By the way: My first pull request :)

angermueller avatar Aug 13 '16 13:08 angermueller

@mikedeboer is there a specific blocking reason to not merge https://github.com/mikedeboer/jsDAV/pull/152 ?

matthiasg avatar Mar 03 '18 10:03 matthiasg