File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,6 @@ export function configureStore({
8686 listenForHistoryChange ( store , history ) ;
8787
8888 window . api = api ;
89- window . environment = environment ;
9089
9190 return { history, store} ;
9291}
Original file line number Diff line number Diff line change @@ -38,7 +38,6 @@ interface Window {
3838 custom_backend ?: string ;
3939 meta_backend ?: string ;
4040 code_assist_backend ?: string ;
41- environment ?: string ;
4241
4342 react_app_disable_checks ?: boolean ;
4443
Original file line number Diff line number Diff line change 1+ import { environment } from '../store' ;
2+
13import { normalizePathSlashes } from '.' ;
24
35const protocolRegex = / ^ h t t p [ s ] ? : \/ \/ / ;
@@ -65,8 +67,16 @@ export function prepareBackendFromBalancer(rawBalancer: string) {
6567
6668 // Use meta_backend if it is defined to form backend url
6769 if ( window . meta_backend ) {
68- const envPrefix = window . environment ? `/${ window . environment } ` : '' ;
69- return normalizePathSlashes ( `${ envPrefix } /${ window . meta_backend } /${ preparedBalancer } ` ) ;
70+ const metaBackend = window . meta_backend ;
71+ const envPrefix = environment ? `/${ environment } ` : '' ;
72+
73+ // If meta_backend is a full URL (has protocol), don't add leading slash
74+ if ( protocolRegex . test ( metaBackend ) ) {
75+ return normalizePathSlashes ( `${ metaBackend } /${ preparedBalancer } ` ) ;
76+ }
77+
78+ // For relative meta_backend, include environment prefix
79+ return normalizePathSlashes ( `${ envPrefix } /${ metaBackend } /${ preparedBalancer } ` ) ;
7080 }
7181
7282 return preparedBalancer ;
You can’t perform that action at this time.
0 commit comments