Skip to content

Commit 68e3ff6

Browse files
committed
Fix URL endpoint for configurationHasChanged
If the endpoint did not have a trailing slash then configurationHasChanged would not work correctly. Signed-off-by: Christian Bilevits <[email protected]>
1 parent 6609f58 commit 68e3ff6

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)