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

prepare-response

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prepare-response - npm Package Compare versions

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": {

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