Comparing version 2.3.2 to 2.4.0
@@ -14,2 +14,3 @@ 'use strict'; | ||
var lowercaseKeys = require('lowercase-keys'); | ||
var status = require('statuses'); | ||
@@ -69,3 +70,3 @@ function got(url, opts, cb) { | ||
// redirect | ||
if (statusCode >= 300 && statusCode < 400 && 'location' in res.headers) { | ||
if (status.redirect[statusCode] && 'location' in res.headers) { | ||
res.resume(); // Discard response | ||
@@ -90,3 +91,3 @@ | ||
read(res, encoding, function (error, data) { | ||
var err = error || new Error('Couldn\'t connect to ' + url + '.'); | ||
var err = error || new Error(url + ' response code is ' + statusCode + ' (' + status[statusCode] + ')'); | ||
err.code = statusCode; | ||
@@ -93,0 +94,0 @@ cb(err, data, response); |
{ | ||
"name": "got", | ||
"version": "2.3.2", | ||
"version": "2.4.0", | ||
"description": "Simplified HTTP/HTTPS requests", | ||
@@ -48,2 +48,3 @@ "license": "MIT", | ||
"read-all-stream": "^1.0.0", | ||
"statuses": "^1.2.1", | ||
"timed-out": "^2.0.0" | ||
@@ -50,0 +51,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7950
133
9
+ Addedstatuses@^1.2.1
+ Addedstatuses@1.5.0(transitive)