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 1.1.2 to 1.2.0

4

index.js

@@ -83,3 +83,5 @@ const http = require('http')

let c = caseless(request.headers)
c.set('accept', 'application/json')
if (!c.get('accept')) {
c.set('accept', 'application/json')
}
}

@@ -86,0 +88,0 @@ return new Promise((resolve, reject) => {

{
"name": "bent",
"version": "1.1.2",
"version": "1.2.0",
"description": "Functional HTTP client for Node.js w/ async/await.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -72,2 +72,14 @@ const http = require('http')

paths['/media-type'] = (req, res) => {
res.setHeader('content-type', 'application/json')
res.end(JSON.stringify({ok: 200, accept: req.headers.accept}))
}
httpTest('json based media type', async t => {
t.plan(1)
let request = bent('json', { accept: 'application/vnd.something.com' })
let json = await request('http://localhost:3000/media-type')
t.same({ok: 200, accept: 'application/vnd.something.com'}, json)
})
test('basic PUT', async t => {

@@ -74,0 +86,0 @@ t.plan(2)

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