mikedeboer / jsDAV

jsDAV allows you to easily add WebDAV support to a NodeJS application. jsDAV is meant to cover the entire standard, and attempts to allow integration using an easy to understand API.
http://www.mikedeboer.nl
MIT License
681 stars 159 forks source link

Fix validateLock being called more than once #93

Closed bancek closed 10 years ago

bancek commented 10 years ago

Node crashes if locked file is locked again.

Error: Can't render headers after they are sent to the client.

How to reproduce:

node examples/fileserver.js
curl localhost:8000/1.txt -X LOCK -H "Content-type: text/xml" -d '<?xml version="1.0"?><A:lockinfo xmlns:A="DAV:"><A:locktype><A:write/></A:locktype><A:lockscope><A:shared/></A:lockscope><A:owner><A:href>CURL</A:href></A:owner></A:lockinfo>'
curl localhost:8000/1.txt -X LOCK -H "Content-type: text/xml" -d '<?xml version="1.0"?><A:lockinfo xmlns:A="DAV:"><A:locktype><A:write/></A:locktype><A:lockscope><A:shared/></A:lockscope><A:owner><A:href>CURL</A:href></A:owner></A:lockinfo>'
mikedeboer commented 10 years ago

Thanks for tracking this down!