mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-23 20:50:00 +00:00
fix(core): Do not use url.includes to check for domain names (#13802)
This commit is contained in:
committed by
GitHub
parent
9d698edceb
commit
d3bc80c22b
@@ -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) =>
|
||||
|
||||
Reference in New Issue
Block a user