simple-get
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -14,4 +14,3 @@ module.exports = simpleGet | ||
function simpleGet (opts, cb) { | ||
opts = typeof opts === 'string' ? { url: opts } : Object.assign({}, opts) | ||
opts = Object.assign({ maxRedirects: 10 }, opts) | ||
opts = Object.assign({ maxRedirects: 10 }, typeof opts === 'string' ? { url: opts } : opts) | ||
cb = once(cb) | ||
@@ -26,3 +25,3 @@ | ||
const headers = {'accept-encoding': 'gzip, deflate'} | ||
const headers = { 'accept-encoding': 'gzip, deflate' } | ||
if (opts.headers) Object.keys(opts.headers).forEach(k => (headers[k.toLowerCase()] = opts.headers[k])) | ||
@@ -61,3 +60,3 @@ opts.headers = headers | ||
if (opts.maxRedirects-- === 0) return cb(new Error('too many redirects')) | ||
return simpleGet(opts, cb) | ||
else return simpleGet(opts, cb) | ||
} | ||
@@ -64,0 +63,0 @@ |
{ | ||
"name": "simple-get", | ||
"description": "Simplest way to make http get requests. Supports HTTPS, redirects, gzip/deflate, streams in < 100 lines.", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Feross Aboukhadijeh", |
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
12802
83