MCPcopy Create free account
hub / github.com/Effect-TS/effect / isHttp2

Function isHttp2

packages/platform/node/src/NodeHttpServer.ts:607–607  ·  view source on GitHub ↗
(request: Http.IncomingMessage | undefined)

Source from the content-addressed store, hash-verified

605 new HttpServerError({ reason: new InternalError({ request, description, cause }) })
606
607const isHttp2 = (request: Http.IncomingMessage | undefined): boolean => request?.httpVersionMajor === 2
608
609// HTTP/2 sends the authority as `:authority`, which takes precedence over a Host header.
610// Pseudo-headers are not valid header names elsewhere, such as in a web `Request`.

Callers 4

requestHeadersFunction · 0.85
originalUrlMethod · 0.85
writeHeadFunction · 0.85
handleCauseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected