var basic   = require('../../lib/index'),
    http    = require('http');


var auth    = basic(function (user, pass, callback) {
    if (user === 'let' && pass === 'me in') return callback(null);
    callback(401);
});

http.createServer(function (req, res) {
    auth(req, res, function (err) {
        if (err) {
            res.writeHead(err);
            res.end();
        }

        res.writeHead(200);
        res.end();
    });
}).listen(8000);
@@ -301,93 +301,8 @@
     
-if (err) %7B%0A            res.writeHead(err);%0A            res.end();%0A        %7D%0A%0A        
 res.
@@ -311,16 +311,23 @@
 iteHead(
+err %7C%7C 
 200);%0A  

Update example