fix(core): Do not use url.includes to check for domain names (#13802)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-03-19 12:29:00 +01:00
committed by GitHub
parent 9d698edceb
commit d3bc80c22b
6 changed files with 13 additions and 11 deletions

View File

@@ -77,7 +77,8 @@ export async function modelSearch(
filter?: string,
): Promise<INodeListSearchResult> {
const credentials = await this.getCredentials<{ url: string }>('openAiApi');
const isCustomAPI = credentials.url && !credentials.url.includes('api.openai.com');
const url = credentials.url && new URL(credentials.url);
const isCustomAPI = url && url.hostname !== 'api.openai.com';
return await getModelSearch(
(model) =>