Socket
Socket
Sign inDemoInstall

bent

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bent - npm Package Compare versions

Comparing version 6.0.12 to 6.1.0

2

package.json
{
"name": "bent",
"version": "6.0.12",
"version": "6.1.0",
"description": "Functional HTTP client for Node.js w/ async/await.",

@@ -5,0 +5,0 @@ "main": "src/nodejs.js",

@@ -87,12 +87,19 @@ 'use strict'

}
if (Buffer.isBuffer(body) || typeof body === 'string') {
req.end(body)
if (Buffer.isBuffer(body)) {
// noop
} else if (typeof body === 'string') {
body = Buffer.from(body)
} else if (isStream(body)) {
body.pipe(req)
body = null
} else if (typeof body === 'object') {
req.setHeader('content-type', 'application/json')
req.end(JSON.stringify(body))
body = Buffer.from(JSON.stringify(body))
} else {
reject(new Error('Unknown body type.'))
}
if (body) {
req.setHeader('content-length', body.length)
req.end(body)
}
} else {

@@ -99,0 +106,0 @@ req.end()

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