I have the following code (simplified):
function(req, res) {
var path = 'login';
req.on('end', function(data) {
var post = parsevars(rawpost, '&');
if (typeof post.username !== 'undefined' && typeof post.password !== 'undefined') {
if (handlelogin(post.username, post.password))
path = req.url;
}
});
}
The bold part is what doesn't work as expected :/
Any input on how to escape this scope restriction would be great.
leakthepathin some other closures where you expect it to change when theendfires? otherwise I don't see how it would matter for the outer function that declared it.