Browse Source

fix: remove ending slash form test connection url

Removes the ending slash when testing openai and ollama api url.
Zyfax 4 months ago
parent
commit
e353f15a3c
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/lib/components/AddConnectionModal.svelte

+ 6 - 0
src/lib/components/AddConnectionModal.svelte

@@ -49,6 +49,9 @@
 	let loading = false;
 
 	const verifyOllamaHandler = async () => {
+		// remove trailing slash from url
+		url = url.replace(/\/$/, '');
+
 		const res = await verifyOllamaConnection(localStorage.token, {
 			url,
 			key
@@ -62,6 +65,9 @@
 	};
 
 	const verifyOpenAIHandler = async () => {
+		// remove trailing slash from url
+		url = url.replace(/\/$/, '');
+
 		const res = await verifyOpenAIConnection(
 			localStorage.token,
 			{