make KAI url-fixing as flexible as webUI's
This commit is contained in:
parent
ea809023b5
commit
2d07cce1dd
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue