diff --git a/open-sse/handlers/search.ts b/open-sse/handlers/search.ts index bb5fce6ea9..a3441dbc2e 100644 --- a/open-sse/handlers/search.ts +++ b/open-sse/handlers/search.ts @@ -322,7 +322,7 @@ function buildBraveRequest( url: `${config.baseUrl}${endpoint}?${qp}`, init: { method: "GET", - headers: { Accept: "application/json", "X-Subscription-Token": params.token }, + headers: { Accept: "application/json", "X-Subscription-Token": params.token ?? "" }, }, }; } @@ -348,7 +348,7 @@ function buildExaRequest( url: config.baseUrl, init: { method: "POST", - headers: { "Content-Type": "application/json", "x-api-key": params.token }, + headers: { "Content-Type": "application/json", "x-api-key": params.token ?? "" }, body: JSON.stringify(body), }, }; diff --git a/src/lib/search/executeWebSearch.ts b/src/lib/search/executeWebSearch.ts index d712e6dbde..a39f343437 100644 --- a/src/lib/search/executeWebSearch.ts +++ b/src/lib/search/executeWebSearch.ts @@ -222,7 +222,7 @@ export async function executeWebSearch( .filter((provider) => supportsSearchType(provider, searchType)) .sort((a, b) => a.costPerQuery - b.costPerQuery) .map((provider) => provider.id) - .filter((providerId) => providerId !== providerConfig.id); + .filter((providerId) => providerId !== providerConfig!.id); for (const providerId of otherIds) { const creds = await resolveSearchCredentials(providerId);