Socket
Socket
Sign inDemoInstall

got

Package Overview
Dependencies
Maintainers
3
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

got - npm Package Compare versions

Comparing version 6.6.3 to 6.7.0

30

index.js
'use strict';
const EventEmitter = require('events').EventEmitter;
const EventEmitter = require('events');
const http = require('http');

@@ -17,12 +17,6 @@ const https = require('https');

const createErrorClass = require('create-error-class');
const nodeStatusCodes = require('node-status-codes');
const isRetryAllowed = require('is-retry-allowed');
const pkg = require('./package.json');
const Buffer = require('safe-buffer').Buffer;
const pkg = require('./package');
const isModernBuffer = (
typeof Buffer.alloc === 'function' &&
typeof Buffer.allocUnsafe === 'function' &&
typeof Buffer.from === 'function'
);
function requestAsEventEmitter(opts) {

@@ -51,5 +45,3 @@ opts = opts || {};

const bufferString = isModernBuffer ?
Buffer.from(res.headers.location, 'binary').toString() :
new Buffer(res.headers.location, 'binary').toString();
const bufferString = Buffer.from(res.headers.location, 'binary').toString();

@@ -90,3 +82,5 @@ redirectUrl = urlLib.resolve(urlLib.format(opts), bufferString);

setImmediate(() => ee.emit('request', req));
setImmediate(() => {
ee.emit('request', req);
});
};

@@ -327,5 +321,5 @@

helpers.forEach(el => {
for (const el of helpers) {
got.stream[el] = (url, opts) => got.stream(url, Object.assign({}, opts, {method: el}));
});
}

@@ -351,3 +345,3 @@ function stdError(error, opts) {

this.statusCode = statusCode;
this.statusMessage = nodeStatusCodes[this.statusCode];
this.statusMessage = http.STATUS_CODES[this.statusCode];
this.message = `${e.message} in "${urlLib.format(opts)}": \n${data.slice(0, 77)}...`;

@@ -359,3 +353,3 @@ });

this.statusCode = statusCode;
this.statusMessage = nodeStatusCodes[this.statusCode];
this.statusMessage = http.STATUS_CODES[this.statusCode];
this.message = `Response code ${this.statusCode} (${this.statusMessage})`;

@@ -367,3 +361,3 @@ });

this.statusCode = statusCode;
this.statusMessage = nodeStatusCodes[this.statusCode];
this.statusMessage = http.STATUS_CODES[this.statusCode];
this.message = 'Redirected 10 times. Aborting.';

@@ -370,0 +364,0 @@ });

16

package.json
{
"name": "got",
"version": "6.6.3",
"version": "6.7.0",
"description": "Simplified HTTP requests",

@@ -50,3 +50,3 @@ "license": "MIT",

"duplexer3": "^0.1.4",
"get-stream": "^2.3.0",
"get-stream": "^3.0.0",
"is-redirect": "^1.0.0",

@@ -56,4 +56,4 @@ "is-retry-allowed": "^1.0.0",

"lowercase-keys": "^1.0.0",
"node-status-codes": "^2.0.0",
"timed-out": "^3.0.0",
"safe-buffer": "^5.0.1",
"timed-out": "^4.0.0",
"unzip-response": "^2.0.1",

@@ -63,9 +63,8 @@ "url-parse-lax": "^1.0.0"

"devDependencies": {
"ava": "^0.16.0",
"ava": "^0.17.0",
"coveralls": "^2.11.4",
"form-data": "^2.1.1",
"get-port": "^2.0.0",
"get-stream": "^2.3.0",
"into-stream": "^3.0.0",
"nyc": "^8.1.0",
"nyc": "^10.0.0",
"pem": "^1.4.4",

@@ -78,3 +77,6 @@ "pify": "^2.3.0",

"esnext": true
},
"ava": {
"concurrency": 4
}
}

@@ -113,6 +113,8 @@ <h1 align="center">

Type: `number`
Type: `number`, `object`
Milliseconds to wait for a server to send response headers before aborting request with `ETIMEDOUT` error.
Option accepts `object` with separate `connect` and `socket` fields for connection and socket inactivity timeouts.
###### retries

@@ -119,0 +121,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