Copy 'relaxed api url' functionality over to webui
This commit is contained in:
parent
75bb0d641f
commit
128945aaaa
|
@ -6,6 +6,10 @@ import {
|
|||
setGenerationParamsFromPreset,
|
||||
} from "../script.js";
|
||||
|
||||
import {
|
||||
power_user,
|
||||
} from "./power-user.js";
|
||||
|
||||
export {
|
||||
textgenerationwebui_settings,
|
||||
loadTextGenSettings,
|
||||
|
@ -98,9 +102,10 @@ function selectPreset(name) {
|
|||
function formatTextGenURL(value) {
|
||||
try {
|
||||
const url = new URL(value);
|
||||
if (url.pathname.endsWith('/api')) {
|
||||
return url.toString();
|
||||
if (!power_user.relaxed_api_urls) {
|
||||
url.pathname = '/api';
|
||||
}
|
||||
return url.toString();
|
||||
} catch { } // Try and Catch both fall through to the same return.
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue