MCPcopy Create free account
hub / github.com/arctic-cli/interface / normalizeBaseUrl

Function normalizeBaseUrl

packages/arctic/src/auth/codex.ts:73–85  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

71 }
72
73 function normalizeBaseUrl(input: string): string {
74 let baseUrl = input
75 while (baseUrl.endsWith("/")) {
76 baseUrl = baseUrl.slice(0, -1)
77 }
78 if (
79 (baseUrl.startsWith("https://chatgpt.com") || baseUrl.startsWith("https://chat.openai.com")) &&
80 !baseUrl.includes("/backend-api")
81 ) {
82 baseUrl = `${baseUrl}/backend-api`
83 }
84 return baseUrl
85 }
86
87 function issuerPath(path: string): string {
88 const base = Config.issuerBaseUrl.replace(/\/$/, "")

Callers 1

getFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected