chrisroberts / dav4rack

WebDAV for Rack
http://chrisroberts.github.com/dav4rack
Other
114 stars 52 forks source link

FileResourceLock#unlock_token nil root path and variable not defined #54

Open pifleo opened 11 years ago

pifleo commented 11 years ago

Hi,

I'm still trying to implement webdav in my app.

When testing lock and unlock with Office I had the following error: TypeError: can't convert nil into String in file_resource_lock.rb:80:in join after some research I found that root is not passed to #find_by_token in FileResource#unlock line:262.

Long to find, easy to patch. But then #unlock as an undefined variable tok, I supposed it was struct.

And finally, its need a little more investigation, but MS Word remove the first and last characters of the token when calling unlock then the store never find any token. I give a look at what is send to the webdav client and the token seem ok. I don't know enough about webdav and have no clue where to look, maybe Word misinterpret the xml sent or just want to be upsetting. I made a monkey patch to find the good token.

MS Word generate a lot of lock request and fill the token table for the loaded file. Maybe the destroy action should clean all tokens for a given file.