https-proxy-agent
Advanced tools
@@ -27,10 +27,8 @@ "use strict"; | ||
| socket.removeListener('error', onerror); | ||
| socket.removeListener('close', onclose); | ||
| socket.removeListener('readable', read); | ||
| } | ||
| function onclose(err) { | ||
| debug('onclose had error %o', err); | ||
| } | ||
| function onend() { | ||
| cleanup(); | ||
| debug('onend'); | ||
| reject(new Error('Proxy connection ended before receiving CONNECT response')); | ||
| } | ||
@@ -56,3 +54,4 @@ function onerror(err) { | ||
| if (!firstLine) { | ||
| throw new Error('No header received'); | ||
| socket.destroy(); | ||
| return reject(new Error('No header received from proxy CONNECT response')); | ||
| } | ||
@@ -68,3 +67,4 @@ const firstLineParts = firstLine.split(' '); | ||
| if (firstColon === -1) { | ||
| throw new Error(`Invalid header: "${header}"`); | ||
| socket.destroy(); | ||
| return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`)); | ||
| } | ||
@@ -84,3 +84,3 @@ const key = header.slice(0, firstColon).toLowerCase(); | ||
| } | ||
| debug('got proxy server response: %o', firstLine); | ||
| debug('got proxy server response: %o %o', firstLine, headers); | ||
| cleanup(); | ||
@@ -97,3 +97,2 @@ resolve({ | ||
| socket.on('error', onerror); | ||
| socket.on('close', onclose); | ||
| socket.on('end', onend); | ||
@@ -100,0 +99,0 @@ read(); |
+2
-2
| { | ||
| "name": "https-proxy-agent", | ||
| "version": "6.2.0", | ||
| "version": "6.2.1", | ||
| "description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS", | ||
@@ -32,3 +32,3 @@ "main": "./dist/index.js", | ||
| "@types/node": "^14.18.45", | ||
| "async-listen": "^2.1.0", | ||
| "async-listen": "^3.0.0", | ||
| "async-retry": "^1.3.3", | ||
@@ -35,0 +35,0 @@ "jest": "^29.5.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
34972
0.25%507
-0.2%