We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6602cd1 commit e7045a1Copy full SHA for e7045a1
1 file changed
frontend/src/main.ts
@@ -24,9 +24,11 @@ declare global {
24
}
25
26
27
-// Check if we have an api url in local storage and use it if that's the case
+// Check if we have an api url in local storage and use it if the bundled
28
+// frontend did not provide one. This prevents stale values from another host
29
+// from overriding the same-origin default and causing CORS failures.
30
const apiUrlFromStorage = localStorage.getItem('API_URL')
-if (apiUrlFromStorage !== null) {
31
+if (apiUrlFromStorage !== null && window.API_URL === '') {
32
window.API_URL = apiUrlFromStorage
33
34
0 commit comments