New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lambda-api

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambda-api - npm Package Compare versions

Comparing version 0.11.0 to 0.11.1

4

index.js

@@ -48,3 +48,5 @@ 'use strict';

this._compression =
props && typeof props.compression === 'boolean'
props &&
(typeof props.compression === 'boolean' ||
Array.isArray(props.compression))
? props.compression

@@ -51,0 +53,0 @@ : false;

@@ -11,3 +11,6 @@ 'use strict';

exports.compress = (input, headers) => {
const defaultEnabledEcodings = ['gzip', 'deflate'];
exports.compress = (input, headers, _enabledEncodings) => {
const enabledEncodings = new Set(_enabledEncodings || defaultEnabledEcodings);
const acceptEncodingHeader = headers['accept-encoding'] || '';

@@ -24,2 +27,3 @@ const acceptableEncodings = new Set(

acceptableEncodings.has('br') &&
enabledEncodings.has('br') &&
typeof zlib.brotliCompressSync === 'function'

@@ -34,3 +38,3 @@ ) {

// Handle Gzip compression
if (acceptableEncodings.has('gzip')) {
if (acceptableEncodings.has('gzip') && enabledEncodings.has('gzip')) {
return {

@@ -43,3 +47,3 @@ data: zlib.gzipSync(input),

// Handle deflate compression
if (acceptableEncodings.has('deflate')) {
if (acceptableEncodings.has('deflate') && enabledEncodings.has('deflate')) {
return {

@@ -46,0 +50,0 @@ data: zlib.deflateSync(input),

@@ -569,3 +569,4 @@ 'use strict';

this._response.body,
this._request.headers
this._request.headers,
Array.isArray(this._compression) ? this._compression : null
);

@@ -572,0 +573,0 @@ if (contentEncoding) {

{
"name": "lambda-api",
"version": "0.11.0",
"version": "0.11.1",
"description": "Lightweight web framework for your serverless applications",

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

Sorry, the diff of this file is too big to display

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