Cleanup query string encoding on services API call
Signed-off-by: Dustin Brewer <mannkind@thenullpointer.net>
This commit is contained in:
@@ -81,10 +81,10 @@ export class FireHydrantAPIClient implements FireHydrantAPI {
|
||||
lookupByName: boolean;
|
||||
}): Promise<ServiceDetailsResponse> {
|
||||
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(
|
||||
|
||||
Reference in New Issue
Block a user