Closed lusy closed 12 years ago
can you show us which lines of code do you mean?
do you think that this solution solves the problem? (these are lines 96-106 of the xappy.js) -> if the parser returns an error, we return with the callback, otherwise we send the parsedRequest through the validator as well
parse(pathname, function (err, xappyReq) { var content = req.headers['content-type']; if (err) { callback(res, content, err, xappyReq); } else { validate(xappyReq, function(err, xappyReq){ callback(res, content, err, xappyReq); }); } });
done since rewrite of xappy.js
so that callbacks make sense. otherwise validator is called on the parsed request before it's known whether the parsing returns an error or no