Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

express-static-gzip

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-static-gzip - npm Package Compare versions

Comparing version
2.0.6
to
2.0.7
+3
-0
.github/workflows/nodejs.yml

@@ -7,2 +7,5 @@ name: Node CI

- master
pull_request:
branches:
- master

@@ -9,0 +12,0 @@ jobs:

+1
-1
{
"name": "express-static-gzip",
"version": "2.0.6",
"version": "2.0.7",
"description": "simple wrapper on top of express.static, that allows serving pre-gziped files",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -5,2 +5,3 @@

[![npm][npm-version-image]][npm-url]
![Node CI](https://github.com/tkoenig89/express-static-gzip/workflows/Node%20CI/badge.svg?branch=master&event=push)
[![npm][npm-downloads-image]][npm-url]

@@ -7,0 +8,0 @@ [![Donate][donate-paypal-image]][donate-url]

@@ -68,2 +68,12 @@ const expect = require('chai').expect;

});
it('should treat identity as null', function () {
const result = findEncoding('identity;q=1, gzip;q=0.5', [GZIP]);
expect(result).to.be.null;
});
it('should not use encodings with q=0', function () {
const result = findEncoding('br;q=1, *;q=0', [GZIP]);
expect(result).to.be.null;
});
});
// see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding
// Indicates the identity function (i.e. no compression, nor modification)
const IDENTITY = 'identity';
/**

@@ -21,2 +24,5 @@ *

for (const encoding of sortedEncodingList) {
if (encoding === IDENTITY) {
return null;
}
for (let i = 0; i < availableCompressions.length; i++) {

@@ -62,2 +68,3 @@ if (encoding === '*' || encoding === availableCompressions[i].encodingName) {

.sort((encodingA, encodingB) => encodingB.q - encodingA.q)
.filter(encoding => encoding.q > 0)
.map(encoding => encoding.name);

@@ -90,2 +97,2 @@ }

findEncoding: findEncoding
};
};