simple-get
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -77,4 +77,5 @@ module.exports = simpleGet | ||
if (loc.protocol) opts.protocol = loc.protocol | ||
if (loc.auth) opts.auth = loc.auth | ||
opts.path = loc.path | ||
delete opts.url | ||
} |
{ | ||
"name": "simple-get", | ||
"description": "Simplest way to make http get requests. Supports HTTPS, redirects, gzip/deflate, streams in < 100 lines.", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"author": { | ||
@@ -24,3 +24,3 @@ "name": "Feross Aboukhadijeh", | ||
"self-signed-https": "^1.0.5", | ||
"standard": "^6.0.5", | ||
"standard": "^7.0.1", | ||
"string-to-stream": "^1.0.0", | ||
@@ -27,0 +27,0 @@ "tape": "^4.0.0" |
@@ -34,2 +34,24 @@ var concat = require('concat-stream') | ||
test('basic auth', function (t) { | ||
t.plan(4) | ||
var server = http.createServer(function (req, res) { | ||
t.equal(req.headers.authorization, 'Basic Zm9vOmJhcg==') | ||
res.statusCode = 200 | ||
res.end('response') | ||
}) | ||
server.listen(0, function () { | ||
var port = server.address().port | ||
get('http://foo:bar@localhost:' + port, function (err, res) { | ||
t.error(err) | ||
t.equal(res.statusCode, 200) | ||
res.pipe(concat(function (data) { | ||
t.equal(data.toString(), 'response') | ||
server.close() | ||
})) | ||
}) | ||
}) | ||
}) | ||
test('follow redirects (up to 10)', function (t) { | ||
@@ -36,0 +58,0 @@ t.plan(13) |
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
16746
400