From 68e3ff617cb01d5ac059bf9c57594520073566be Mon Sep 17 00:00:00 2001 From: Christian Bilevits Date: Mon, 17 Mar 2025 14:56:02 +0100 Subject: [PATCH] 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 --- .../providers/go-feature-flag/src/lib/controller/goff-api.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/providers/go-feature-flag/src/lib/controller/goff-api.ts b/libs/providers/go-feature-flag/src/lib/controller/goff-api.ts index 9ee935e1f..1d3aab9c3 100644 --- a/libs/providers/go-feature-flag/src/lib/controller/goff-api.ts +++ b/libs/providers/go-feature-flag/src/lib/controller/goff-api.ts @@ -183,7 +183,8 @@ export class GoffApiController { } public async configurationHasChanged(): Promise { - const url = `${this.endpoint}v1/flag/change`; + const endpointURL = new URL(this.endpoint); + endpointURL.pathname = 'v1/flag/change'; const headers: any = { 'Content-Type': 'application/json', @@ -193,7 +194,7 @@ export class GoffApiController { headers['If-None-Match'] = this.etag; } try { - const response = await axios.get(url, { headers }); + const response = await axios.get(endpointURL.toString(), { headers }); if (response.status === 304) { return ConfigurationChange.FLAG_CONFIGURATION_NOT_CHANGED; }