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

http2-proxy

Package Overview
Dependencies
Maintainers
1
Versions
193
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http2-proxy - npm Package Compare versions

Comparing version 4.2.8 to 4.2.9

33

index.js

@@ -28,4 +28,2 @@ const http = require('http')

function noop () {}
const kReq = Symbol('req')

@@ -143,4 +141,3 @@ const kRes = Symbol('res')

} else {
process.nextTick(onComplete.bind(res), new HttpError(`invalid protocol`, null, 500))
return promise
throw new HttpError(`invalid protocol`, null, 500)
}

@@ -160,3 +157,2 @@ proxyReq = agent.request(reqOptions)

.on('close', onComplete)
// XXX: Node doesn't always emit 'close' after 'finish'.
.on('finish', onComplete)

@@ -183,2 +179,10 @@ .on('error', onComplete)

const callback = res[kProxyCallback]
if (!callback) {
return
}
res[kProxyCallback] = null
res

@@ -205,6 +209,2 @@ .removeListener('close', onComplete)

if (proxySocket) {
proxySocket
.removeListener('error', onComplete)
.removeListener('close', onProxyAborted)
proxySocket.on('error', noop)
if (proxySocket.destroy) {

@@ -216,7 +216,2 @@ proxySocket.destroy()

if (proxyRes) {
proxyRes
.removeListener('error', onComplete)
.removeListener('end', onComplete)
.removeListener('aborted', onProxyAborted)
proxyRes.on('error', noop)
if (proxyRes.destroy) {

@@ -228,8 +223,2 @@ proxyRes.destroy()

if (proxyReq) {
proxyReq
.removeListener('error', onComplete)
.removeListener('timeout', onProxyTimeout)
.removeListener('response', onProxyResponse)
.removeListener('upgrade', onProxyUpgrade)
proxyReq.on('error', noop)
if (proxyReq.abort) {

@@ -254,5 +243,5 @@ proxyReq.abort()

if (res[kHead] === undefined) {
res[kProxyCallback].call(res[kSelf], err, req, res, { proxyReq, proxyRes })
callback.call(res[kSelf], err, req, res, { proxyReq, proxyRes })
} else {
res[kProxyCallback].call(res[kSelf], err, req, res, res[kHead], { proxyReq, proxyRes, proxySocket })
callback.call(res[kSelf], err, req, res, res[kHead], { proxyReq, proxyRes, proxySocket })
}

@@ -259,0 +248,0 @@ }

{
"name": "http2-proxy",
"version": "4.2.8",
"version": "4.2.9",
"scripts": {

@@ -5,0 +5,0 @@ "dev": "nodemon --inspect=9308 src",

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