Socket
Socket
Sign inDemoInstall

got

Package Overview
Dependencies
Maintainers
4
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 8.0.3 to 8.1.0

15

index.js

@@ -340,3 +340,3 @@ 'use strict';

if (statusCode !== 304 && (statusCode < 200 || statusCode > limitStatusCode)) {
if (opts.throwHttpErrors && statusCode !== 304 && (statusCode < 200 || statusCode > limitStatusCode)) {
throw new got.HTTPError(statusCode, res.statusMessage, res.headers, opts);

@@ -429,3 +429,3 @@ }

if (statusCode !== 304 && (statusCode < 200 || statusCode > 299)) {
if (opts.throwHttpErrors && statusCode !== 304 && (statusCode < 200 || statusCode > 299)) {
proxy.emit('error', new got.HTTPError(statusCode, res.statusMessage, res.headers, opts), null, res);

@@ -472,3 +472,4 @@ return;

decompress: true,
useElectronNet: false
useElectronNet: false,
throwHttpErrors: true
},

@@ -591,3 +592,9 @@ url,

try {
return asPromise(normalizeArguments(url, opts));
const normalizedArgs = normalizeArguments(url, opts);
if (normalizedArgs.stream) {
return asStream(normalizedArgs);
}
return asPromise(normalizedArgs);
} catch (err) {

@@ -594,0 +601,0 @@ return Promise.reject(err);

{
"name": "got",
"version": "8.0.3",
"version": "8.1.0",
"description": "Simplified HTTP requests",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -108,2 +108,9 @@ <div align="center">

###### stream
Type: `boolean`<br>
Default: `false`
Returns a `Stream` instead of a `Promise`. This is equivalent to calling `got.stream(url, [options])`.
###### body

@@ -210,3 +217,11 @@

###### throwHttpErrors
Type: `boolean`<br>
Default: `true`
Determines if a `got.HTTPError` is thrown for error responses (non-2xx status codes).
If this is disabled, requests that encounter an error status code will be resolved with the `response` instead of throwing. This may be useful if you are checking for resource availability and are expecting error responses.
#### Streams

@@ -213,0 +228,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