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

connect-gzip

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-gzip - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

test/fixtures/index.html.1303515662000.gz

14

lib/staticGzip.js

@@ -58,2 +58,7 @@ /*!

// Potentially malicious path
if (~filename.indexOf('..')) {
return passToStatic(filename);
}
// Check for requested file

@@ -66,5 +71,5 @@ fs.stat(filename, function(err, stat) {

// Check for compressed file
var gzipname = path.join(path.dirname(filename),
Number(stat.mtime) + '.gz.' + path.basename(filename)
);
var base = path.basename(filename),
dir = path.dirname(filename),
gzipname = path.join(dir, base + '.' + Number(stat.mtime) + '.gz');
fs.stat(gzipname, function(err) {

@@ -84,2 +89,5 @@ if (err && err.code === 'ENOENT') {

function sendGzip() {
var charset = mime.charsets.lookup(type),
contentType = type + (charset ? '; charset=' + charset : '');
res.setHeader('Content-Type', contentType);
res.setHeader('Content-Encoding', 'gzip');

@@ -86,0 +94,0 @@ res.setHeader('Vary', 'Accept-Encoding');

{
"name": "connect-gzip",
"description": "Gzip middleware for Connect. Based on implementation in Connect 0.5.9. Original source: https://github.com/senchalabs/connect/tree/c9a0c1e0e98451bb5fffb70c622b827a11bf4fc7",
"version": "0.0.1",
"version": "0.1.0",
"author": "Nate Smith",
"main": "./index.js",
"dependencies": {
"connect": ">= 1.0.0",
"connect": ">= 1.4.0",
"mime": ">= 0.0.1"
}
},
"engines": {
"node": "*"
},
"directories": {
"lib": "./lib"
},
"files": [
""
]
}
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