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 7.3.0 to 7.3.1

2

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

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

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

if (compression[enc]) {
resp = resp.pipe(compression[enc]())
const decompress = compression[enc]()
decompress.on('error', (e) => ret.emit('error', new Error('ZBufError', e)))
resp = resp.pipe(decompress)
} else {

@@ -127,2 +129,3 @@ break

res = getResponse(res)
res.on('error', reject)
decodings(res)

@@ -129,0 +132,0 @@ res.status = res.statusCode

@@ -6,2 +6,5 @@ 'use strict'

const assert = require('assert')
const zlib = require('zlib')
const ttype = (e, str) => same(e.constructor.name, str)
const qs = require('querystring')

@@ -11,4 +14,2 @@ const test = it

const ttype = (e, str) => same(e.constructor.name, str)
test('Invalid encoding', done => {

@@ -103,1 +104,24 @@ try {

})
if (!process.browser) {
test('Z_BUF_ERROR error', async () => {
const request = bent('json')
try {
await request('https://echo-server.mikeal.now.sh/src/echo.js?headers=content-encoding%3Agzip%2Ccontent-type%3Aapplication%2Fjson')
} catch (e) {
ttype(e, 'Error')
return e
}
})
test('gzip json compresssion SyntaxError', async () => {
const request = bent('json')
const base64 = zlib.gzipSync('ok').toString('base64')
const headers = 'content-encoding:gzip,content-type:application/json'
try {
await request(`https://echo-server.mikeal.now.sh/src/echo.js?${qs.stringify({ base64, headers })}`)
} catch (e) {
ttype(e, 'SyntaxError')
return e
}
})
}
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