From c5afe933bbbaa6037e42b6516156fc135d11905b Mon Sep 17 00:00:00 2001 From: Dustin Brewer Date: Fri, 10 Mar 2023 16:00:32 +0000 Subject: [PATCH] Cleanup query string encoding on services API call Signed-off-by: Dustin Brewer --- plugins/firehydrant/src/api/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/firehydrant/src/api/index.ts b/plugins/firehydrant/src/api/index.ts index 45834d90e9..1cbf10ec9b 100644 --- a/plugins/firehydrant/src/api/index.ts +++ b/plugins/firehydrant/src/api/index.ts @@ -81,10 +81,10 @@ export class FireHydrantAPIClient implements FireHydrantAPI { lookupByName: boolean; }): Promise { const queryOpt = options.lookupByName ? 'name' : 'query'; + const query = new URLSearchParams(); + query.set(queryOpt, options.serviceName); const proxyUrl = await this.getApiUrl(); - const response = await fetch( - `${proxyUrl}/services?${queryOpt}=${options.serviceName}`, - ); + const response = await fetch(`${proxyUrl}/services?${query}`); if (!response.ok) { throw new Error(