Socket
Socket
Sign inDemoInstall

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.3 to 2.2.4

2

index.js

@@ -25,3 +25,3 @@ module.exports = simpleGet

if (opts.json && body) opts.headers['content-type'] = 'application/json'
if (body) opts.headers['Content-Length'] = body.length
if (body) opts.headers['Content-Length'] = Buffer.byteLength(body)

@@ -28,0 +28,0 @@ // Request gzip/deflate

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

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

@@ -320,2 +320,28 @@ var concat = require('concat-stream')

test('post (utf-8 text body)', function (t) {
t.plan(4)
var server = http.createServer(function (req, res) {
t.equal(req.method, 'POST')
res.statusCode = 200
req.pipe(res)
})
server.listen(0, function () {
var port = server.address().port
var opts = {
url: 'http://localhost:' + port,
body: 'jedan dva tri četiri'
}
get.post(opts, function (err, res) {
t.error(err)
t.equal(res.statusCode, 200)
res.pipe(concat(function (data) {
t.equal(data.toString(), 'jedan dva tri četiri')
server.close()
}))
})
})
})
test('post (buffer body)', function (t) {

@@ -322,0 +348,0 @@ t.plan(4)

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