Skip to content

Commit

Permalink
Merge f5f13d2 into 68ea9f2
Browse files Browse the repository at this point in the history
  • Loading branch information
biotic-labor committed May 14, 2015
2 parents 68ea9f2 + f5f13d2 commit 44cf632
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -59,7 +59,7 @@ module.exports = function favicon(path, options){
}

return function favicon(req, res, next){
if (parseUrl(req).pathname !== '/favicon.ico') {
if (parseUrl(req).pathname.indexOf('/favicon.ico') === -1) {
next();
return;
}
Expand Down
7 changes: 7 additions & 0 deletions test/test.js
Expand Up @@ -121,6 +121,13 @@ describe('favicon()', function(){
.expect(200, done);
});

it('should serve icon', function(done){
request(server)
.get('/somePath/favicon.ico')
.expect('Content-Type', 'image/x-icon')
.expect(200, done);
});

it('should include cache-control', function(done){
request(server)
.get('/favicon.ico')
Expand Down

0 comments on commit 44cf632

Please sign in to comment.