fix: simplify protocol further
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
kolaente 2023-03-26 16:35:02 +02:00
parent 57aff0a827
commit a6494ee4f3
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 1 additions and 3 deletions

View File

@ -10,8 +10,6 @@ export const checkAndSetApiUrl = (url: string): Promise<string> => {
url = window.location.host + url
}
const shouldCheckHttps = window.location.protocol === 'https:'
// Check if the url has a http prefix
if (
!url.startsWith('http://') &&
@ -23,7 +21,7 @@ export const checkAndSetApiUrl = (url: string): Promise<string> => {
const urlToCheck: URL = new URL(url)
const origUrlToCheck = urlToCheck
urlToCheck.protocol = shouldCheckHttps ? 'https:' : 'http:'
urlToCheck.protocol = window.location.protocol
const oldUrl = window.API_URL
window.API_URL = urlToCheck.toString()