MCPcopy
hub / github.com/coder/mux / getNormalizedUpgradeRoute

Function getNormalizedUpgradeRoute

src/node/orpc/server.ts:647–658  ·  view source on GitHub ↗
(
  requestUrl: string | undefined
)

Source from the content-addressed store, hash-verified

645}
646
647function getNormalizedUpgradeRoute(
648 requestUrl: string | undefined
649): { routePathname: string; routeUrl: string } | null {
650 const publicPathname = getPathnameFromRequestUrl(requestUrl);
651 if (!publicPathname) {
652 return null;
653 }
654
655 const { routePathname } = stripAppProxyBasePath(publicPathname);
656 const querySuffix = splitRequestUrlPathAndQuery(requestUrl)?.querySuffix ?? "";
657 return { routePathname, routeUrl: `${routePathname}${querySuffix}` };
658}
659
660function isSafeHttpHostHeader(host: string): boolean {
661 if (host.trim().length === 0 || host.includes("/") || host.includes("\\")) {

Callers 1

createOrpcServerFunction · 0.85

Calls 3

stripAppProxyBasePathFunction · 0.90

Tested by

no test coverage detected