all files / modules/middleware/ favicon.js

100% Statements 5/5
75% Branches 3/4
100% Functions 2/2
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14                 
/**
 * A middleware that returns the given response to requests for "/favicon.ico".
 * Defaults to returning an empty 404.
 */
function favicon(app, response) {
    response = response || 404;
 
    return function (conn) {
        return conn.pathname === "/favicon.ico" ? response : conn.call(app);
    };
}
 
module.exports = favicon;