From 0b709c93a8a2fa9892b720255a87717c2741e11c Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 8 Apr 2022 10:57:44 +0200 Subject: [PATCH] fix: html/apiUrls cannot end with / --- src/routes/sources/[id]/_Github.svelte | 8 ++++---- src/routes/sources/[id]/_Gitlab.svelte | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/routes/sources/[id]/_Github.svelte b/src/routes/sources/[id]/_Github.svelte index af776cfea..6b8aa0c89 100644 --- a/src/routes/sources/[id]/_Github.svelte +++ b/src/routes/sources/[id]/_Github.svelte @@ -12,8 +12,8 @@ try { await post(`/sources/${id}.json`, { name: source.name, - htmlUrl: source.htmlUrl, - apiUrl: source.apiUrl + htmlUrl: source.htmlUrl.replace(/\/$/, ''), + apiUrl: source.apiUrl.replace(/\/$/, '') }); toast.push('Settings saved.'); } catch ({ error }) { @@ -50,8 +50,8 @@ await post(`/sources/${id}/github.json`, { type: 'github', name: source.name, - htmlUrl: source.htmlUrl, - apiUrl: source.apiUrl + htmlUrl: source.htmlUrl.replace(/\/$/, ''), + apiUrl: source.apiUrl.replace(/\/$/, '') }); } catch ({ error }) { return errorNotification(error); diff --git a/src/routes/sources/[id]/_Gitlab.svelte b/src/routes/sources/[id]/_Gitlab.svelte index 89e43cfe3..b528b1850 100644 --- a/src/routes/sources/[id]/_Gitlab.svelte +++ b/src/routes/sources/[id]/_Gitlab.svelte @@ -38,8 +38,8 @@ await post(`/sources/${id}/gitlab.json`, { type: 'gitlab', name: source.name, - htmlUrl: source.htmlUrl, - apiUrl: source.apiUrl, + htmlUrl: source.htmlUrl.replace(/\/$/, ''), + apiUrl: source.apiUrl.replace(/\/$/, ''), oauthId: source.gitlabApp.oauthId, appId: source.gitlabApp.appId, appSecret: source.gitlabApp.appSecret, @@ -56,8 +56,8 @@ try { await post(`/sources/${id}.json`, { name: source.name, - htmlUrl: source.htmlUrl, - apiUrl: source.apiUrl + htmlUrl: source.htmlUrl.replace(/\/$/, ''), + apiUrl: source.apiUrl.replace(/\/$/, '') }); } catch ({ error }) { return errorNotification(error);