(proxyUrl: string | undefined)
| 41 | let originalNodeTlsRejectUnauthorized: string | undefined |
| 42 | |
| 43 | function 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 | |
| 59 | function restoreGlobalFetchPatch(): void { |
| 60 | if (!fetchPatched) { |
no test coverage detected