Skip to content

Commit 2e18349

Browse files
committed
Tighten HTTP2 case coverage with unreachableCheck
1 parent b895baf commit 2e18349

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/server/http-combo-server.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ export async function createComboServer(options: ComboServerOptions): Promise<De
177177
? ['h2', 'http/1.1', 'http 1.1'] // 'http 1.1' is non-standard, but used by https-proxy-agent
178178
: options.http2 === 'fallback'
179179
? ['http/1.1', 'http 1.1', 'h2']
180-
// options.http2 === false:
181-
: ['http/1.1', 'http 1.1'];
180+
: options.http2 === false
181+
? ['http/1.1', 'http 1.1']
182+
: unreachableCheck(options.http2);
182183

183184
const ALPNOption: tls.TlsOptions = semver.satisfies(process.version, '>=20.4.0')
184185
? {

0 commit comments

Comments
 (0)