fix(audit): fallback the baseUrl properly using || to avoid relative POSTs on empty string

This commit is contained in:
2026-07-11 20:53:33 +00:00
parent 21c18afd02
commit 830091564c
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -114,7 +114,7 @@ async function callMinimax(
onProgress?: (msg: string) => void,
): Promise<string> {
onProgress?.('Enviando para MiniMax...');
const url = config.baseUrl ?? 'https://api.minimax.chat/v1/chat/completions';
const url = config.baseUrl || 'https://api.minimax.chat/v1/chat/completions';
const body = {
model: config.model,
messages: [
@@ -146,7 +146,7 @@ async function callOpenRouter(
onProgress?: (msg: string) => void,
): Promise<string> {
onProgress?.('Enviando para OpenRouter...');
const url = config.baseUrl ?? 'https://openrouter.ai/api/v1/chat/completions';
const url = config.baseUrl || 'https://openrouter.ai/api/v1/chat/completions';
const body = {
model: config.model,
messages: [
@@ -183,7 +183,7 @@ async function callOllama(
onProgress?: (msg: string) => void,
): Promise<string> {
onProgress?.('Enviando para Ollama (local)...');
const baseUrl = config.baseUrl ?? 'http://localhost:11434';
const baseUrl = config.baseUrl || 'http://localhost:11434';
const body = {
model: config.model,
messages: [