| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d908c83 commit a731463
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -284,9 +284,8 @@ function handleSocketAfterProxy(err, req) { | |||
| 284 | 284 | if (err.code === 'ERR_PROXY_TUNNEL') { | |
| 285 | 285 | if (err.proxyTunnelTimeout) { | |
| 286 | 286 | req.emit('timeout'); // Propagate the timeout from the tunnel to the request. | |
| 287 | - } else { | ||
| 288 | - req.emit('error', err); | ||
| 289 | 287 | } | |
| 288 | + req.emit('error', err); | ||
| 290 | 289 | } | |
| 291 | 290 | } | |
| 292 | 291 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -958,7 +958,8 @@ function onSocketNT(req, socket, err) { | |||
| 958 | 958 | if (!req.aborted && !err) { | |
| 959 | 959 | err = new ConnResetException('socket hang up'); | |
| 960 | 960 | } | |
| 961 | - if (err) { | ||
| 961 | + // ERR_PROXY_TUNNEL is handled by the proxying logic | ||
| 962 | + if (err && err.code !== 'ERR_PROXY_TUNNEL') { | ||
| 962 | 963 | emitErrorEvent(req, err); | |
| 963 | 964 | } | |
| 964 | 965 | req._closed = true; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,7 +43,7 @@ const { code, signal, stderr, stdout } = await runProxiedRequest({ | |||
| 43 | 43 | }); | |
| 44 | 44 | ||
| 45 | 45 | // The proxy client should get an error from failure in establishing the tunnel. | |
| 46 | - assert.match(stderr, /ERR_PROXY_TUNNEL.*Failed to establish tunnel to .* NOT-HTTP MALFORMED RESPONSE/); | ||
| 46 | + assert.strictEqual(stderr.match(/ERR_PROXY_TUNNEL.*Failed to establish tunnel to .* NOT-HTTP MALFORMED RESPONSE*/g).length, 1); | ||
| 47 | 47 | assert.strictEqual(stdout.trim(), ''); | |
| 48 | 48 | assert.strictEqual(code, 0); | |
| 49 | 49 | assert.strictEqual(signal, null); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,7 +43,7 @@ const { code, signal, stderr, stdout } = await runProxiedRequest({ | |||
| 43 | 43 | }); | |
| 44 | 44 | ||
| 45 | 45 | // The proxy client should get an error from failure in establishing the tunnel. | |
| 46 | - assert.match(stderr, /ERR_PROXY_TUNNEL.*Failed to establish tunnel to .* HTTP\/1\.1 404 Not Found/); | ||
| 46 | + assert.strictEqual(stderr.match(/ERR_PROXY_TUNNEL.*Failed to establish tunnel to .* HTTP\/1\.1 404 Not Found/g).length, 1); | ||
| 47 | 47 | assert.strictEqual(stdout.trim(), ''); | |
| 48 | 48 | assert.strictEqual(code, 0); | |
| 49 | 49 | assert.strictEqual(signal, null); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,7 +44,7 @@ const { code, signal, stderr, stdout } = await runProxiedRequest({ | |||
| 44 | 44 | }); | |
| 45 | 45 | ||
| 46 | 46 | // The proxy client should get an error from failure in establishing the tunnel. | |
| 47 | - assert.match(stderr, /ERR_PROXY_TUNNEL.*Failed to establish tunnel to .* HTTP\/1\.1 500 Connection Error/); | ||
| 47 | + assert.strictEqual(stderr.match(/ERR_PROXY_TUNNEL.*Failed to establish tunnel to .* HTTP\/1\.1 500 Connection Error/g).length, 1); | ||
| 48 | 48 | assert.strictEqual(stdout.trim(), ''); | |
| 49 | 49 | assert.strictEqual(code, 0); | |
| 50 | 50 | assert.strictEqual(signal, null); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,7 +42,7 @@ const { code, signal, stderr, stdout } = await runProxiedRequest({ | |||
| 42 | 42 | }); | |
| 43 | 43 | ||
| 44 | 44 | // The proxy client should get an error from failure in establishing the tunnel. | |
| 45 | - assert.match(stderr, /ERR_PROXY_TUNNEL.*Failed to establish tunnel to .* HTTP\/1\.1 502 Bad Gateway/); | ||
| 45 | + assert.strictEqual(stderr.match(/ERR_PROXY_TUNNEL.*Failed to establish tunnel to .* HTTP\/1\.1 502 Bad Gateway/g).length, 1); | ||
| 46 | 46 | assert.strictEqual(stdout.trim(), ''); | |
| 47 | 47 | assert.strictEqual(code, 0); | |
| 48 | 48 | assert.strictEqual(signal, null); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments