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.

Home Page:http://www.mikedeboer.nl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dispatchEvent with multiple arguments in the callback

mnutt opened this issue · comments

I noticed in lib/DAV/handler.js in createFile() it does:

self.dispatchEvent("beforeCreateFile", uri, dataOrStream, enc, parent, function(stop, etag) {

This looks like it was added in d9a1005 for parity with the way other functions pass an etag. But is it possible to actually pass an etag back as a second argument in my beforeCreateFile handler? Or if not, is there a workaround for it?

Right now I'm just not calling e.next() at all from my listener and just finishing the request myself, but it means I have to disable the listener timeouts which seems ugly.

Sorry for the late reply! I think you should be able to pass back an etag - just like the other beforeCreateFile handlers do. Please check the linked commit 😉