Skip status check of invalid custom endpoint URLs Fixes #3683
| @@ -57,6 +57,7 @@ import { | ||
| 57 | 57 | getSortableDelay, |
| 58 | 58 | getStringHash, |
| 59 | 59 | isDataURL, |
| 60 | + isValidUrl, | |
| 60 | 61 | parseJsonFile, |
| 61 | 62 | resetScrollHeight, |
| 62 | 63 | stringFormat, |
| @@ -3490,6 +3491,12 @@ async function getStatusOpen() { | ||
| 3490 | 3491 | return resultCheckStatus(); |
| 3491 | 3492 | } |
| 3492 | 3493 | |
| 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 | + | |
| 3493 | 3500 | let data = { |
| 3494 | 3501 | reverse_proxy: oai_settings.reverse_proxy, |
| 3495 | 3502 | proxy_password: oai_settings.proxy_password, |