File tree Expand file tree Collapse file tree
packages/core/src/plugins Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,19 +93,19 @@ export class SegmentDestination extends DestinationPlugin {
9393 const hasProxy = ! ! ( config ?. proxy ?? '' ) ;
9494 const useSegmentEndpoints = Boolean ( config ?. useSegmentEndpoints ) ;
9595 // Determine the base URL based on config or this.apiHost, defaulting to defaultApiHost
96- let baseURL = config ?. proxy ?? this . apiHost ?? defaultApiHost ;
97-
98- // If baseURL is null or undefined, fallback to defaultApiHost
99- if ( ! baseURL ) {
100- baseURL = defaultApiHost ;
101- }
96+ const baseURL = config ?. proxy ?? this . apiHost ?? defaultApiHost ;
10297
10398 let endpoint = '' ;
10499
105100 if ( hasProxy ) {
106101 endpoint = useSegmentEndpoints ? '/b' : '' ;
107102 } else {
108- endpoint = baseURL === defaultApiHost ? '' : '/b' ;
103+ // Check if baseURL ends with '/b', if so, do not append '/b'
104+ if ( baseURL . endsWith ( '/b' ) ) {
105+ endpoint = '' ; // Don't append '/b'
106+ } else {
107+ endpoint = '/b' ; // Append '/b'
108+ }
109109 }
110110
111111 return getURL ( baseURL , endpoint ) ;
You can’t perform that action at this time.
0 commit comments