Socket
Socket
Sign inDemoInstall

http2-proxy

Package Overview
Dependencies
0
Maintainers
1
Versions
193
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.8 to 0.2.9

23

index.js

@@ -66,2 +66,7 @@ const http2 = require('http2')

// XXX http2.Http2ServerRequest doesn't forward stream errors.
// (https://github.com/nodejs/node/issues/15359)
(req.stream || req).on('error', onError)
resOrSocket.on('error', onError)
try {

@@ -87,3 +92,3 @@ if (resOrSocket instanceof net.Socket) {

.split(',')
.some(name => sanatizeHeaderName(name).endsWith(proxyName.toLowerCase()))
.some(name => sanitize(name).endsWith(proxyName.toLowerCase()))
) {

@@ -128,5 +133,2 @@ throw createError('loop detected', null, 508)

// NOTE http2.Http2ServerRequest doesn't forward stream errors.
(req.stream || req).on('error', onError)
return proxy(req, resOrSocket, options, onRes, onError)

@@ -173,5 +175,6 @@ } catch (err) {

})
// NOTE http.ClientRequest doesn't emit 'aborted'. Instead it emits
// XXX http.ClientRequest doesn't emit 'aborted'. Instead it emits
// a "socket hang up" error.
// .on('aborted', () => callback(new createError.BadGateway('socket hang up')))
// (https://github.com/nodejs/node/pull/15270)
.on('timeout', () => callback(createError('gateway timeout', null, 504)))

@@ -209,3 +212,2 @@ .on('response', proxyRes => {

.pipe(resOrSocket)
.on('error', callback)
}

@@ -246,6 +248,9 @@ } catch (err) {

// XXX Does this overlap socket errors, i.e. duplicate emits?
// (https://github.com/nodejs/node/issues/15360)
proxyRes.on('error', callback)
proxySocket
.on('error', callback)
.pipe(resOrSocket)
.on('error', callback)
.pipe(proxySocket)

@@ -308,3 +313,3 @@ } catch (err) {

for (const name of connection.split(',')) {
delete headers[sanatizeHeaderName(name)]
delete headers[sanitize(name)]
}

@@ -325,3 +330,3 @@ }

function sanatizeHeaderName (name) {
function sanitize (name) {
return name.trim().toLowerCase()

@@ -328,0 +333,0 @@ }

{
"name": "http2-proxy",
"version": "0.2.8",
"version": "0.2.9",
"scripts": {

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc