mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Make 'relaxed api url' even more relaxed.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user