compression
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -0,1 +1,8 @@ | ||
1.0.7 / 2014-06-11 | ||
================== | ||
* use vary module for better `Vary` behavior | ||
* deps: accepts@1.0.3 | ||
* deps: compressible@1.1.0 | ||
1.0.6 / 2014-06-03 | ||
@@ -2,0 +9,0 @@ ================== |
27
index.js
@@ -17,2 +17,3 @@ /*! | ||
var compressible = require('compressible'); | ||
var vary = require('vary'); | ||
@@ -200,27 +201,1 @@ /** | ||
function noop(){} | ||
/** | ||
* Add val to Vary header | ||
*/ | ||
function vary(res, val) { | ||
var header = res.getHeader('Vary') || '' | ||
var headers = Array.isArray(header) | ||
? header.join(', ') | ||
: header | ||
// enumerate current values | ||
var vals = headers.toLowerCase().split(/ *, */) | ||
if (vals.indexOf(val.toLowerCase()) !== -1) { | ||
// already set | ||
return | ||
} | ||
// append value (in existing format) | ||
header = headers | ||
? headers + ', ' + val | ||
: val | ||
res.setHeader('Vary', header) | ||
} |
{ | ||
"name": "compression", | ||
"description": "Compression middleware for connect and node.js", | ||
"version": "1.0.6", | ||
"author": { | ||
"name": "Jonathan Ong", | ||
"email": "me@jongleberry.com", | ||
"url": "http://jongleberry.com", | ||
"twitter": "https://twitter.com/jongleberry" | ||
}, | ||
"version": "1.0.7", | ||
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)", | ||
"contributors": [ | ||
{ | ||
"name": "Douglas Christopher Wilson", | ||
"email": "doug@somethingdoug.com" | ||
} | ||
"Douglas Christopher Wilson <doug@somethingdoug.com>" | ||
], | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/expressjs/compression.git" | ||
}, | ||
"bugs": { | ||
"mail": "me@jongleberry.com", | ||
"url": "https://github.com/expressjs/compression/issues" | ||
}, | ||
"repository": "expressjs/compression", | ||
"dependencies": { | ||
"accepts": "1.0.2", | ||
"accepts": "1.0.3", | ||
"bytes": "1.0.0", | ||
"compressible": "1.0.1", | ||
"on-headers": "0.0.0" | ||
"compressible": "1.1.0", | ||
"on-headers": "0.0.0", | ||
"vary": "0.1.0" | ||
}, | ||
"devDependencies": { | ||
"istanbul": "0.2.10", | ||
"mocha": "~1.20.0", | ||
"mocha": "~1.20.1", | ||
"supertest": "~0.13.0", | ||
"should": "~4.0.0" | ||
"should": "~4.0.1" | ||
}, | ||
@@ -42,6 +28,6 @@ "engines": { | ||
"scripts": { | ||
"test": "mocha --reporter dot", | ||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", | ||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec" | ||
"test": "mocha --check-leaks --reporter dot", | ||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot", | ||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec" | ||
} | ||
} |
@@ -12,10 +12,10 @@ # compression | ||
```js | ||
var express = require('express') | ||
var compress = require('compression') | ||
var express = require('express') | ||
var compression = require('compression') | ||
var app = express() | ||
app.use(compress()) | ||
app.use(compression()) | ||
``` | ||
### compress(options) | ||
### compression(options) | ||
@@ -25,3 +25,3 @@ Returns the compression middleware using the given `options`. | ||
```js | ||
app.use(compress({ | ||
app.use(compression({ | ||
threshold: 512 | ||
@@ -28,0 +28,0 @@ })) |
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
8407
5
157
2
1
+ Addedvary@0.1.0
+ Addedaccepts@1.0.3(transitive)
+ Addedcompressible@1.1.0(transitive)
+ Addednegotiator@0.4.6(transitive)
+ Addedvary@0.1.0(transitive)
- Removedaccepts@1.0.2(transitive)
- Removedcompressible@1.0.1(transitive)
- Removednegotiator@0.4.5(transitive)
Updatedaccepts@1.0.3
Updatedcompressible@1.1.0