mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
fix: make OpenRouter base URL default consistent across codebase
- Replace hardcoded 'https://openrouter.ai' fallback with derived domain from the same default base URL pattern used everywhere else - Extract domain from 'https://openrouter.ai/api/v1' for better consistency - Maintains backward compatibility and existing functionality - All tests still pass Fixes inconsistent OpenRouter base URL default in PR #8951
This commit is contained in:
parent
1ba0150f7a
commit
a57e832c8d
1 changed files with 4 additions and 2 deletions
|
|
@ -1449,9 +1449,11 @@ export class ClineProvider
|
|||
let apiKey: string
|
||||
|
||||
try {
|
||||
const baseUrl = apiConfiguration.openRouterBaseUrl || "https://openrouter.ai/api/v1"
|
||||
const defaultBaseUrl = "https://openrouter.ai/api/v1"
|
||||
const baseUrl = apiConfiguration.openRouterBaseUrl || defaultBaseUrl
|
||||
// Extract the base domain for the auth endpoint.
|
||||
const baseUrlDomain = baseUrl.match(/^(https?:\/\/[^\/]+)/)?.[1] || "https://openrouter.ai"
|
||||
const baseUrlDomain =
|
||||
baseUrl.match(/^(https?:\/\/[^\/]+)/)?.[1] || defaultBaseUrl.match(/^(https?:\/\/[^\/]+)/)?.[1]
|
||||
const response = await axios.post(`${baseUrlDomain}/api/v1/auth/keys`, { code })
|
||||
|
||||
if (response.data && response.data.key) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue