http,https: fix double ERR_PROXY_TUNNEL emission

Fixes: https://github.com/nodejs/node/issues/60697
PR-URL: https://github.com/nodejs/node/pull/60699
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
This commit is contained in:
Shima Ryuhei
2025-11-15 18:29:08 +09:00
committed by GitHub
parent 44ed25a94b
commit 2e944d7de1
6 changed files with 7 additions and 7 deletions

View File

@@ -43,7 +43,7 @@ const { code, signal, stderr, stdout } = await runProxiedRequest({
});
// The proxy client should get an error from failure in establishing the tunnel.
assert.match(stderr, /ERR_PROXY_TUNNEL.*Failed to establish tunnel to .* NOT-HTTP MALFORMED RESPONSE/);
assert.strictEqual(stderr.match(/ERR_PROXY_TUNNEL.*Failed to establish tunnel to .* NOT-HTTP MALFORMED RESPONSE*/g).length, 1);
assert.strictEqual(stdout.trim(), '');
assert.strictEqual(code, 0);
assert.strictEqual(signal, null);

View File

@@ -43,7 +43,7 @@ const { code, signal, stderr, stdout } = await runProxiedRequest({
});
// The proxy client should get an error from failure in establishing the tunnel.
assert.match(stderr, /ERR_PROXY_TUNNEL.*Failed to establish tunnel to .* HTTP\/1\.1 404 Not Found/);
assert.strictEqual(stderr.match(/ERR_PROXY_TUNNEL.*Failed to establish tunnel to .* HTTP\/1\.1 404 Not Found/g).length, 1);
assert.strictEqual(stdout.trim(), '');
assert.strictEqual(code, 0);
assert.strictEqual(signal, null);

View File

@@ -44,7 +44,7 @@ const { code, signal, stderr, stdout } = await runProxiedRequest({
});
// The proxy client should get an error from failure in establishing the tunnel.
assert.match(stderr, /ERR_PROXY_TUNNEL.*Failed to establish tunnel to .* HTTP\/1\.1 500 Connection Error/);
assert.strictEqual(stderr.match(/ERR_PROXY_TUNNEL.*Failed to establish tunnel to .* HTTP\/1\.1 500 Connection Error/g).length, 1);
assert.strictEqual(stdout.trim(), '');
assert.strictEqual(code, 0);
assert.strictEqual(signal, null);

View File

@@ -42,7 +42,7 @@ const { code, signal, stderr, stdout } = await runProxiedRequest({
});
// The proxy client should get an error from failure in establishing the tunnel.
assert.match(stderr, /ERR_PROXY_TUNNEL.*Failed to establish tunnel to .* HTTP\/1\.1 502 Bad Gateway/);
assert.strictEqual(stderr.match(/ERR_PROXY_TUNNEL.*Failed to establish tunnel to .* HTTP\/1\.1 502 Bad Gateway/g).length, 1);
assert.strictEqual(stdout.trim(), '');
assert.strictEqual(code, 0);
assert.strictEqual(signal, null);