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

got

Package Overview
Dependencies
Maintainers
3
Versions
178
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.1.1 to 6.1.2

5

index.js

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

const isRetryAllowed = require('is-retry-allowed');
const pkg = require('./package.json');

@@ -104,3 +105,3 @@ function requestAsEventEmitter(opts) {

if (opts.json && statusCode !== 204) {
if (opts.json && res.body) {
try {

@@ -207,3 +208,3 @@ res.body = JSON.parse(res.body);

opts.headers = Object.assign({
'user-agent': 'https://github.com/sindresorhus/got',
'user-agent': `${pkg.name}/${pkg.version} (https://github.com/sindresorhus/got)`,
'accept-encoding': 'gzip,deflate'

@@ -210,0 +211,0 @@ }, lowercaseKeys(opts.headers));

4

package.json
{
"name": "got",
"version": "6.1.1",
"version": "6.1.2",
"description": "Simplified HTTP/HTTPS requests",

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

"devDependencies": {
"ava": "^0.11.0",
"ava": "^0.12.0",
"coveralls": "^2.11.4",

@@ -65,0 +65,0 @@ "get-port": "^2.0.0",

@@ -121,9 +121,9 @@ <h1 align="center">

Number of request retries when network errors happens. Delays between retries counts with function `Math.pow(2, retry) + Math.random() * 100`, where `retry` is attempt number (starts from 0).
Number of request retries when network errors happens. Delays between retries counts with function `1000 * Math.pow(2, retry) + Math.random() * 100`, where `retry` is attempt number (starts from 0).
**Note:** `ENOTFOUND` and `ENETUNREACH` error will not be retried (see full list in [`is-retry-allowed`](https://github.com/floatdrop/is-retry-allowed/blob/master/index.js#L12) module).
Option accepts `function` with `retry` and `error` arguments. Function must return delay in milliseconds (`0` return value cancels retry).
**Note:** if `retries` is `number`, `ENOTFOUND` and `ENETUNREACH` error will not be retried (see full list in [`is-retry-allowed`](https://github.com/floatdrop/is-retry-allowed/blob/master/index.js#L12) module).
#### Streams

@@ -267,6 +267,7 @@

const got = require('got');
const pkg = require('./package.json');
got('todomvc.com', {
headers: {
'user-agent': 'https://github.com/your-username/repo-name'
'user-agent': `my-module/${pkg.version} (https://github.com/username/my-module)`
}

@@ -273,0 +274,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