소스 검색

fix: remove ending slash form test connection url

Removes the ending slash when testing openai and ollama api url.
Zyfax 8 달 전
부모
커밋
e353f15a3c
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      src/lib/components/AddConnectionModal.svelte

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

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