MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / redactProxyUrl

Function redactProxyUrl

src/utils/networkProxy.ts:43–57  ·  view source on GitHub ↗
(proxyUrl: string | undefined)

Source from the content-addressed store, hash-verified

41let originalNodeTlsRejectUnauthorized: string | undefined
42
43function redactProxyUrl(proxyUrl: string | undefined): string {
44 if (!proxyUrl) {
45 return "(not set)"
46 }
47
48 try {
49 const url = new URL(proxyUrl)
50 url.username = ""
51 url.password = ""
52 return url.toString()
53 } catch {
54 // Fallback for invalid URLs: redact basic auth if present.
55 return proxyUrl.replace(/\/\/[^@/]+@/g, "//REDACTED@")
56 }
57}
58
59function restoreGlobalFetchPatch(): void {
60 if (!fetchPatched) {

Callers 3

initializeNetworkProxyFunction · 0.85
configureGlobalProxyFunction · 0.85
configureUndiciProxyFunction · 0.85

Calls 2

toStringMethod · 0.65
replaceMethod · 0.65

Tested by

no test coverage detected