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 2.2.1 to 2.2.2

4

index.js

@@ -21,2 +21,3 @@ module.exports = simpleGet

if (body && !opts.method) opts.method = 'POST'
if (opts.method) opts.method = opts.method.toUpperCase()

@@ -48,3 +49,4 @@ if (opts.json) opts.headers.accept = 'application/json'

cb(null, typeof unzipResponse === 'function' ? unzipResponse(res) : res)
var tryUnzip = typeof unzipResponse === 'function' && opts.method !== 'HEAD'
cb(null, tryUnzip ? unzipResponse(res) : res)
})

@@ -51,0 +53,0 @@ req.on('error', cb)

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

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

@@ -484,1 +484,28 @@ var concat = require('concat-stream')

})
test('HEAD request', function (t) {
t.plan(3)
var server = http.createServer(function (req, res) {
t.equal(req.method, 'HEAD')
// Taken from real-world response from HEAD request to GitHub.com
res.setHeader('content-type', 'text/html; charset=utf-8')
res.setHeader('content-encoding', 'gzip')
res.setHeader('connection', 'close')
res.statusCode = 200
req.pipe(res)
})
server.listen(0, function () {
var port = server.address().port
var opts = {
method: 'HEAD',
url: 'http://localhost:' + port
}
get.head(opts, function (err, res) {
t.error(err)
t.equal(res.statusCode, 200)
server.close()
})
})
})
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