follow-ups

This commit is contained in:
Max Schmitt 2024-08-22 14:55:11 +02:00
parent 459966e074
commit 07c0769d30
2 changed files with 5 additions and 2 deletions

View file

@ -169,7 +169,10 @@ class SocksProxyConnection {
this.target.removeListener('close', this._targetCloseEventListener);
// @ts-expect-error
const session: http2.ServerHttp2Session = http2.performServerHandshake(internalTLS);
session.on('error', () => this._targetCloseEventListener());
session.on('error', () => {
this.target.destroy();
this._targetCloseEventListener();
});
session.once('stream', (stream: http2.ServerHttp2Stream) => {
stream.respond({
'content-type': 'text/html',

View file

@ -698,7 +698,7 @@ test.describe('browser', () => {
const page = await context.newPage();
// This was triggering an unhandled error before.
await page.goto(serverUrl).catch(e => e);
await page.goto(serverUrl).catch(() => {});
await context.close();
await new Promise<void>(resolve => server.close(() => resolve()));