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

simple-get

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-get - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

11

index.js

@@ -11,6 +11,9 @@ module.exports = simpleGet

if (typeof opts === 'string') opts = { url: opts }
if (typeof cb === 'function') cb = once(cb)
cb = once(cb)
// Follow redirects
if (opts.maxRedirects === 0) return cb(new Error('too many redirects'))
if (opts.maxRedirects === 0) {
cb(new Error('too many redirects'))
return
}
if (!opts.maxRedirects) opts.maxRedirects = 10

@@ -22,3 +25,3 @@

var body = opts.body
delete opts.body
opts.body = undefined
if (body && !opts.method) opts.method = 'POST'

@@ -70,3 +73,3 @@

module.exports.concat = function (opts, cb) {
simpleGet(opts, function (err, res) {
return simpleGet(opts, function (err, res) {
if (err) return cb(err)

@@ -73,0 +76,0 @@ var chunks = []

{
"name": "simple-get",
"description": "Simplest way to make http get requests. Supports HTTPS, redirects, gzip/deflate, streams in < 100 lines.",
"version": "1.3.2",
"version": "1.3.3",
"author": {

@@ -6,0 +6,0 @@ "name": "Feross Aboukhadijeh",

@@ -319,1 +319,23 @@ var concat = require('concat-stream')

})
test('access `req` object', function (t) {
t.plan(2)
var server = http.createServer(function (req, res) {
res.statusCode = 200
res.end('response')
})
server.listen(0, function () {
var port = server.address().port
var req = get('http://localhost:' + port, function (err, res) {
t.error(err)
res.resume() // discard data
server.close()
})
req.on('socket', function () {
t.pass('got `socket` event')
})
})
})
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