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

fastify-compression

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastify-compression - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

17

index.js

@@ -13,12 +13,3 @@ 'use strict';

const supportedEncodings = ['gzip', 'deflate'];
const compressionStreams = {
gzip: zlib.createGzip,
deflate: zlib.createDeflate
}
if (opts.brotli) {
compressionStreams.br = opts.brotli;
supportedEncodings.push('br');
}
fastify.addHook('onSend', compression)

@@ -39,3 +30,3 @@

reply.header('Content-Encoding', method);
const compressionStream = compressionStreams[method]();
const compressionStream = method === 'gzip' ? zlib.createGzip() : zlib.createDeflate();

@@ -57,3 +48,3 @@ pump(payloadStream, compressionStream, onEnd.bind(request))

function setVaryHeader(reply) {
const varyHeader = reply.res.getHeader('Vary');
const varyHeader = reply._headers['vary'];
reply.header('Vary', getVaryHeaderValue(varyHeader));

@@ -77,3 +68,3 @@ }

function isCompressible(reply) {
const contentType = reply.res.getHeader('Content-Type');
const contentType = reply._headers['content-type'];
return contentType ? compressible(contentType) : true;

@@ -83,3 +74,3 @@ }

const metadata = {
fastify: '>=0.43.0',
fastify: '>=1.0.0-rc.3',
name: 'fastify-compression'

@@ -86,0 +77,0 @@ }

{
"name": "fastify-compression",
"version": "0.4.1",
"version": "0.4.2",
"description": "A compression plugin for fastify",

@@ -36,4 +36,4 @@ "main": "index.js",

"devDependencies": {
"eslint": "^4.18.0",
"fastify": "^1.0.0-rc.2",
"eslint": "^4.18.2",
"fastify": "^1.0.0-rc.3",
"request": "^2.83.0",

@@ -40,0 +40,0 @@ "tap": "^11.0.0"

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