(settings, cfg, value, opts = {})
| 160 | } |
| 161 | |
| 162 | function safeStoredUpstreamBaseUrl(settings, cfg, value, opts = {}) { |
| 163 | const baseUrl = normalizeUrl(value); |
| 164 | if (!baseUrl) return ''; |
| 165 | if (baseUrl === normalizeUrl(opts.url)) return ''; |
| 166 | const proxyUrl = normalizeUrl(cfg && cfg.EVOMAP_PROXY_URL); |
| 167 | if (proxyUrl && baseUrl === proxyUrl) return ''; |
| 168 | if (baseUrl === normalizeUrl(cfg && cfg.ANTHROPIC_BASE_URL) |
| 169 | && isManagedProxyBaseUrl(settings, cfg, cfg && cfg.ANTHROPIC_BASE_URL, opts)) { |
| 170 | return ''; |
| 171 | } |
| 172 | return safeUpstreamBaseUrl(value, opts); |
| 173 | } |
| 174 | |
| 175 | function readReusableClientProxyToken(opts = {}) { |
| 176 | const env = opts.env || process.env; |
no test coverage detected