MCPcopy Create free account
hub / github.com/did-method-plc/did-method-plc / is

Method is

packages/server/src/error.ts:33–40  ·  view source on GitHub ↗
(obj: unknown)

Source from the content-addressed store, hash-verified

31
32/**
33 * Releases the raw socket behind an upgrade request that no route took
34 * ownership of, and reports whether it did. Returns false for ordinary
35 * requests, which still want a normal response.
36 *
37 * Both error paths need this. Express skips plain middleware once an error is
38 * in flight, so the cleanup middleware at the end of the stack is unreachable
39 * from either of them, and an upgrade's `res` is a detached dummy that swallows
40 * whatever is written to it — leaving the client hanging until it times out.
41 */
42export const ownsUnhandledUpgrade = (req: Request): boolean =>
43 req.ws !== undefined && req.ws.handled === false

Callers 3

handlerFunction · 0.45
assertValidIncomingOpFunction · 0.45
server.test.tsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected