Skip status check of invalid custom endpoint URLs Fixes #3683

e60796548b09da92db3645a991a84f5cec6206b8

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +7 -0Showing whitespace changes
public/scripts/openai.js+7 -0
@@ -57,6 +57,7 @@ import {
5757 getSortableDelay,
5858 getStringHash,
5959 isDataURL,
60+ isValidUrl,
6061 parseJsonFile,
6162 resetScrollHeight,
6263 stringFormat,
@@ -3490,6 +3491,12 @@ async function getStatusOpen() {
34903491 return resultCheckStatus();
34913492 }
34923493
3494+ if (oai_settings.chat_completion_source === chat_completion_sources.CUSTOM && !isValidUrl(oai_settings.custom_url)) {
3495+ console.debug('Invalid endpoint URL of Custom OpenAI API:', oai_settings.custom_url);
3496+ setOnlineStatus('no_connection');
3497+ return resultCheckStatus();
3498+ }
3499+
34933500 let data = {
34943501 reverse_proxy: oai_settings.reverse_proxy,
34953502 proxy_password: oai_settings.proxy_password,