MCPcopy Create free account
hub / github.com/coder/mux / normalizeProtocol

Function normalizeProtocol

src/node/orpc/server.ts:195–202  ·  view source on GitHub ↗
(rawProtocol: string)

Source from the content-addressed store, hash-verified

193}
194
195function normalizeProtocol(rawProtocol: string): "http" | "https" | null {
196 const normalized = rawProtocol.trim().toLowerCase().replace(/:$/, "");
197 if (normalized === "http" || normalized === "https") {
198 return normalized;
199 }
200
201 return null;
202}
203
204function buildOrigin(protocol: string, host: string): string | null {
205 const normalizedProtocol = normalizeProtocol(protocol);

Callers 5

buildOriginFunction · 0.85
inferProtocolFunction · 0.85
normalizeOriginFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected