You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

compression

Package Overview
Dependencies
Maintainers
7
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.6 to 1.0.7

7

HISTORY.md

@@ -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 @@ }))

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc