MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / isWebSocketUpgradeRequest

Function isWebSocketUpgradeRequest

scripts/studio-host-provider.mjs:721–731  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

719}
720
721function isWebSocketUpgradeRequest(request) {
722 const headers = new Headers(request.headers || {});
723 return (
724 headers.get("upgrade")?.toLowerCase() === "websocket" ||
725 headers
726 .get("connection")
727 ?.toLowerCase()
728 .split(",")
729 .some((value) => value.trim() === "upgrade") === true
730 );
731}
732
733function describeError(error) {
734 if (error instanceof Error) {

Callers 3

handleRpcFunction · 0.70

Calls 1

getMethod · 0.65

Tested by

no test coverage detected