From 90b4f75516bd7497a076148cdd36679e3f3089ea Mon Sep 17 00:00:00 2001 From: Akshay Shekhawat Date: Tue, 29 Nov 2022 23:34:15 -0800 Subject: [PATCH] url encode api keys when deleting --- frontend/src/api/keys/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/api/keys/index.ts b/frontend/src/api/keys/index.ts index 6a4f8cde..6ded8cd1 100644 --- a/frontend/src/api/keys/index.ts +++ b/frontend/src/api/keys/index.ts @@ -22,9 +22,12 @@ export const deleteKey = async ( headers?: AxiosRequestHeaders, ): Promise => { try { - const resp = await axios.delete(`${getAPIURL()}/keys/${key_name}/delete`, { - headers, - }) + const resp = await axios.delete( + `${getAPIURL()}/keys/${encodeURIComponent(key_name)}/delete`, + { + headers, + }, + ) if (resp.status === 200 && resp.data) { return } else {