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

@whatwg-node/node-fetch

Package Overview
Dependencies
Maintainers
1
Versions
509
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@whatwg-node/node-fetch - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2-rc-20230314154619-367ff2a

18

index.js

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

const url = require('url');
const zlib = require('zlib');
const events = require('@whatwg-node/events');

@@ -1327,2 +1328,17 @@ const busboy = _interopDefault(require('busboy'));

nodeRequest.once('response', nodeResponse => {
let responseBody = nodeResponse;
const contentEncoding = nodeResponse.headers['content-encoding'];
switch (contentEncoding) {
case 'x-gzip':
case 'gzip':
responseBody = nodeResponse.pipe(zlib.createGunzip());
break;
case 'x-deflate':
case 'deflate':
responseBody = nodeResponse.pipe(zlib.createInflate());
break;
case 'br':
responseBody = nodeResponse.pipe(zlib.createBrotliDecompress());
break;
}
if (nodeResponse.headers.location) {

@@ -1347,3 +1363,3 @@ if (fetchRequest.redirect === 'error') {

const responseHeaders = nodeResponse.headers;
const ponyfillResponse = new PonyfillResponse(nodeResponse, {
const ponyfillResponse = new PonyfillResponse(responseBody, {
status: nodeResponse.statusCode,

@@ -1350,0 +1366,0 @@ statusText: nodeResponse.statusMessage,

2

package.json
{
"name": "@whatwg-node/node-fetch",
"version": "0.3.1",
"version": "0.3.2-rc-20230314154619-367ff2a",
"description": "Fetch API implementation for Node",

@@ -5,0 +5,0 @@ "sideEffects": false,

Sorry, the diff of this file is not supported yet

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