Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

serve-favicon

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serve-favicon - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

5

History.md

@@ -0,1 +1,6 @@

2.0.1 / 2014-06-05
==================
* Reduce byte size of `ETag` header
2.0.0 / 2014-05-02

@@ -2,0 +7,0 @@ ==================

24

index.js
/*!
* Expressjs | Connect - serve-favicon
* serve-favicon
* Copyright(c) 2010 Sencha Inc.

@@ -48,4 +48,2 @@ * Copyright(c) 2011 TJ Holowaychuk

stat = fs.statSync(path);
if (!stat) throw createNoExistsError(path);
if (stat.isDirectory()) throw createIsDirError(path);

@@ -83,3 +81,3 @@ } else {

'Cache-Control': 'public, max-age=' + ~~(maxAge / 1000),
'etag': '"' + md5(buf) + '"'
'etag': etag(buf)
}

@@ -98,16 +96,8 @@ };

function createNoExistsError(path) {
var error = new Error('ENOENT, no such file or directory \'' + path + '\'');
error.code = 'ENOENT';
error.errno = 34;
error.path = path;
error.syscall = 'open';
return error;
}
function md5(str, encoding){
return crypto
function etag(buf){
var hash = crypto
.createHash('md5')
.update(str, 'utf8')
.digest(encoding || 'hex');
.update(buf)
.digest('base64');
return '"' + hash + '"';
}

@@ -114,0 +104,0 @@

{
"name": "serve-favicon",
"description": "favicon serving middleware with caching",
"version": "2.0.0",
"version": "2.0.1",
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",

@@ -11,9 +11,3 @@ "license": "MIT",

],
"repository": {
"type": "git",
"url": "https://github.com/expressjs/serve-favicon.git"
},
"bugs": {
"url": "https://github.com/expressjs/serve-favicon/issues"
},
"repository": "expressjs/serve-favicon",
"dependencies": {

@@ -23,6 +17,7 @@ "fresh": "0.2.2"

"devDependencies": {
"mocha": "~1.18.2",
"proxyquire": "~0.6.0",
"should": "~3.3.1",
"supertest": "~0.12.0"
"istanbul": "0.2.10",
"mocha": "~1.20.1",
"proxyquire": "~1.0.1",
"should": "~4.0.1",
"supertest": "~0.13.0"
},

@@ -33,4 +28,6 @@ "engines": {

"scripts": {
"test": "mocha --reporter spec test/"
"test": "mocha --reporter dot test/",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec test/"
}
}

@@ -1,3 +0,7 @@

# serve-favicon [![Build Status](https://travis-ci.org/expressjs/serve-favicon.svg)](https://travis-ci.org/expressjs/serve-favicon) [![NPM version](https://badge.fury.io/js/serve-favicon.svg)](http://badge.fury.io/js/serve-favicon)
# serve-favicon
[![NPM version](https://badge.fury.io/js/serve-favicon.svg)](http://badge.fury.io/js/serve-favicon)
[![Build Status](https://travis-ci.org/expressjs/serve-favicon.svg?branch=master)](https://travis-ci.org/expressjs/serve-favicon)
[![Coverage Status](https://img.shields.io/coveralls/expressjs/serve-favicon.svg?branch=master)](https://coveralls.io/r/expressjs/serve-favicon)
Node.js middleware for serving a favicon.

@@ -4,0 +8,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc