make KAI url-fixing as flexible as webUI's

This commit is contained in:
50h100a 2023-08-03 16:28:02 -04:00
parent ea809023b5
commit 2d07cce1dd
1 changed files with 5 additions and 6 deletions

View File

@ -35,12 +35,11 @@ const MIN_STREAMING_KCPPVERSION = '1.30';
function formatKoboldUrl(value) {
try {
const url = new URL(value);
url.pathname = '/api';
return url.toString();
}
catch {
return null;
}
if (url.pathname.endsWith('/api')) {
return url.toString();
}
} catch { } // Try and Catch both fall through to the same return.
return null;
}
function loadKoboldSettings(preset) {