From da399a7ec51a47f3972a83abedaa5ca939c92192 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 16 Feb 2022 12:52:32 -0800 Subject: [PATCH] Encode uri URL --- packages/webapp/src/classes/client/rest-client/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/webapp/src/classes/client/rest-client/index.ts b/packages/webapp/src/classes/client/rest-client/index.ts index bab11c5a..0cb227e6 100644 --- a/packages/webapp/src/classes/client/rest-client/index.ts +++ b/packages/webapp/src/classes/client/rest-client/index.ts @@ -35,7 +35,7 @@ export default class RestClient implements Client { deleteMapPermission(id: number, email: string): Promise { const handler = (success: () => void, reject: (error: ErrorInfo) => void) => { axios - .delete(`${this.baseUrl}/c/restful/maps/${id}/collabs?email=${email}`, { + .delete(`${this.baseUrl}/c/restful/maps/${id}/collabs?email=${encodeURIComponent(email)}`, { headers: { 'Content-Type': 'text/plain' }, }) .then(() => { @@ -181,7 +181,7 @@ export default class RestClient implements Client { const handler = (success: (mapId: number) => void, reject: (error: ErrorInfo) => void) => { axios .post( - `${this.baseUrl}/c/restful/maps?title=${model.title}&description=${model.description ? model.description : '' + `${this.baseUrl}/c/restful/maps?title=${encodeURIComponent(model.title)}&description=${model.description ? model.description : '' }`, model.content, { headers: { 'Content-Type': 'application/xml' } } @@ -426,7 +426,7 @@ export default class RestClient implements Client { resetPassword(email: string): Promise { const handler = (success: () => void, reject: (error: ErrorInfo) => void) => { axios - .put(`${this.baseUrl}/service/users/resetPassword?email=${email}`, null, { + .put(`${this.baseUrl}/service/users/resetPassword?email=${encodeURIComponent(email)}`, null, { headers: { 'Content-Type': 'application/json' }, }) .then(() => {