MCPcopy Create free account
hub / github.com/codeaashu/claude-code / normalizeUrl

Function normalizeUrl

src/services/mcp/xaa.ts:61–67  ·  view source on GitHub ↗

* RFC 8414 §3.3 / RFC 9728 §3.3 identifier comparison. Roundtrip through URL * to apply RFC 3986 §6.2.2 syntax-based normalization (lowercases scheme+host, * drops default port), then strip trailing slash.

(url: string)

Source from the content-addressed store, hash-verified

59 * drops default port), then strip trailing slash.
60 */
61function normalizeUrl(url: string): string {
62 try {
63 return new URL(url).href.replace(/\/$/, '')
64 } catch {
65 return url.replace(/\/$/, '')
66 }
67}
68
69/**
70 * Thrown by requestJwtAuthorizationGrant when the IdP token-exchange leg

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected