Skip to content

Commit ce6a8e1

Browse files
fix(gofeatureflag): Error for configurationHasChanged when slash was missing in endpoint (#1229)
Co-authored-by: Thomas Poignant <[email protected]>
1 parent ee676d8 commit ce6a8e1

File tree

1 file changed

+3
-2
lines changed
  • libs/providers/go-feature-flag/src/lib/controller

1 file changed

+3
-2
lines changed

libs/providers/go-feature-flag/src/lib/controller/goff-api.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ export class GoffApiController {
183183
}
184184

185185
public async configurationHasChanged(): Promise<ConfigurationChange> {
186-
const url = `${this.endpoint}v1/flag/change`;
186+
const endpointURL = new URL(this.endpoint);
187+
endpointURL.pathname = 'v1/flag/change';
187188

188189
const headers: any = {
189190
'Content-Type': 'application/json',
@@ -193,7 +194,7 @@ export class GoffApiController {
193194
headers['If-None-Match'] = this.etag;
194195
}
195196
try {
196-
const response = await axios.get(url, { headers });
197+
const response = await axios.get(endpointURL.toString(), { headers });
197198
if (response.status === 304) {
198199
return ConfigurationChange.FLAG_CONFIGURATION_NOT_CHANGED;
199200
}

0 commit comments

Comments
 (0)