mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-27 01:17:41 +01:00
Make 'relaxed api url' even more relaxed.
This commit is contained in:
parent
4ae3e9db0a
commit
75bb0d641f
@ -39,14 +39,10 @@ const MIN_STREAMING_KCPPVERSION = '1.30';
|
||||
function formatKoboldUrl(value) {
|
||||
try {
|
||||
const url = new URL(value);
|
||||
if (power_user.relaxed_api_urls) {
|
||||
if (url.pathname.endsWith('/api')) {
|
||||
return url.toString();
|
||||
}
|
||||
} else {
|
||||
if (!power_user.relaxed_api_urls) {
|
||||
url.pathname = '/api';
|
||||
return url.toString();
|
||||
}
|
||||
return url.toString();
|
||||
} catch { } // Try and Catch both fall through to the same return.
|
||||
return null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user