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

rock-req

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rock-req - npm Package Compare versions

Comparing version 5.0.1 to 5.0.2

13

index.js

@@ -88,3 +88,2 @@ module.exports = extend()

}
// or redirect and leave

@@ -115,3 +114,2 @@ if (opts.followRedirects !== false && res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {

}
// or read response and leave at the end

@@ -132,7 +130,10 @@ response = res

req.once('timeout', () => {
// This timeout event can come after the input pipeline is finished (ex. timeout with no body)
const _error = new Error('TimeoutError'); _error.code = 'ETIMEDOUT'
req.destroy() // we must destroy manually
onRequestEnd(_error) // This timeout event can come after the input pipeline is finished (ex. timeout with no body)
req.destroy(_error) // we must destroy manually and send the error to the error listener to call onRequestEnd
})
req.once('error', (e) => {
onRequestEnd(e) // error can happen before pipeline is executed when some interceptor are used such as nock
req.destroy()
})
const _inputStream = isFnStream(body) ? body(opts) : Readable.from([body], { objectMode: false })

@@ -142,3 +143,2 @@ pipeline(_inputStream, req, (e) => {

})
return req

@@ -160,4 +160,3 @@ }

rock.extend = extend
return rock
}
{
"name": "rock-req",
"description": "Zero dependencies (160 LOC) & rock-solid request library: http/https, reliable retry on failure, redirects, gzip/deflate/brotli, extensible, proxy, streams, JSON mode, forms, timeout",
"version": "5.0.1",
"version": "5.0.2",
"author": {

@@ -6,0 +6,0 @@ "name": "David Grelaud & Feross Aboukhadijeh"

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