prepare-response
Advanced tools
Comparing version 1.1.2 to 1.1.3
15
index.js
@@ -65,9 +65,2 @@ 'use strict'; | ||
if (this.options.etag !== false) { | ||
// vary | ||
if (!res.getHeader('Vary')) { | ||
res.setHeader('Vary', 'Accept-Encoding'); | ||
} else if (!~res.getHeader('Vary').indexOf('Accept-Encoding')) { | ||
res.setHeader('Vary', res.getHeader('Vary') + ', Accept-Encoding'); | ||
} | ||
//check old etag | ||
@@ -85,2 +78,10 @@ if (req.headers['if-none-match'] === this.etag) { | ||
//add gzip | ||
if (this.options.gzip !== false) { | ||
// vary | ||
if (!res.getHeader('Vary')) { | ||
res.setHeader('Vary', 'Accept-Encoding'); | ||
} else if (!~res.getHeader('Vary').indexOf('Accept-Encoding')) { | ||
res.setHeader('Vary', res.getHeader('Vary') + ', Accept-Encoding'); | ||
} | ||
} | ||
if (this.options.gzip !== false && supportsGzip(req)) { | ||
@@ -87,0 +88,0 @@ res.setHeader('Content-Encoding', 'gzip'); |
{ | ||
"name": "prepare-response", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Prepare a text resposne to be efficiently sent", | ||
@@ -12,11 +12,10 @@ "keywords": [], | ||
"dependencies": { | ||
"mime": "~1.2.11", | ||
"ms": "~0.6.2", | ||
"promise": "^5.0.0" | ||
"mime": "^1.3.4", | ||
"ms": "^0.7.1", | ||
"promise": "^7.0.4" | ||
}, | ||
"devDependencies": { | ||
"testit": "~1.2.0", | ||
"express": "~4.6.1", | ||
"promise": "~5.0.0", | ||
"concat-stream": "~1.4.6" | ||
"concat-stream": "^1.5.1", | ||
"express": "^4.13.3", | ||
"testit": "^2.0.2" | ||
}, | ||
@@ -23,0 +22,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6761
3
104
+ Addedasap@2.0.6(transitive)
+ Addedmime@1.6.0(transitive)
+ Addedms@0.7.3(transitive)
+ Addedpromise@7.3.1(transitive)
- Removedasap@1.0.0(transitive)
- Removedmime@1.2.11(transitive)
- Removedms@0.6.2(transitive)
- Removedpromise@5.0.0(transitive)
Updatedmime@^1.3.4
Updatedms@^0.7.1
Updatedpromise@^7.0.4