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

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 7.1.1 to 7.1.2

2

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

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

@@ -136,3 +136,5 @@ 'use strict'

} else if (typeof body === 'object') {
req.setHeader('content-type', 'application/json')
if (!c.has('content-type')) {
req.setHeader('content-type', 'application/json')
}
body = Buffer.from(JSON.stringify(body))

@@ -139,0 +141,0 @@ } else {

@@ -8,2 +8,4 @@ /* globals atob, it */

const http = require('http')
const test = it

@@ -162,2 +164,19 @@

})
test('manually-set content-type header when body is present', async () => {
const server = http.createServer((request, response) => {
response.statusCode = request.headers['content-type'] === 'application/jose+json' ? 200 : 400
response.end()
})
await new Promise((resolve, reject) => {
server.listen(9999, () => {
resolve()
})
})
const request = bent('POST')
const response = request('http://localhost:9999', { ok: true }, { 'content-type': 'application/jose+json' })
const info = await response
same(info.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