fix: simplify protocol further
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
parent
57aff0a827
commit
a6494ee4f3
|
@ -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()
|
||||
|
|
Reference in New Issue
Block a user