From 8ddb9cb7ebc1d073a1d854087b57583dd26216ed Mon Sep 17 00:00:00 2001 From: owidder Date: Sun, 6 Nov 2022 20:41:18 +0100 Subject: [PATCH] fix(ui): encode groupId to allow '&' as part of the name of a consumer group (#1184) relate to #1143 --- client/src/utils/endpoints.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/client/src/utils/endpoints.js b/client/src/utils/endpoints.js index 199beb90b..d0fb21e6a 100644 --- a/client/src/utils/endpoints.js +++ b/client/src/utils/endpoints.js @@ -238,34 +238,34 @@ export const uriConsumerGroups = (clusterId, search, pageNumber) => { }; export const uriConsumerGroup = (clusterId, groupId) => { - return `${apiUrl}/${clusterId}/group/${groupId}`; + return `${apiUrl}/${clusterId}/group/${encodeURIComponent(groupId)}`; }; export const uriConsumerGroupTopics = (clusterId, groupId) => { - return `${apiUrl}/group/topics?clusterId=${clusterId}&groupId=${groupId}`; + return `${apiUrl}/group/topics?clusterId=${clusterId}&groupId=${encodeURIComponent(groupId)}`; }; export const uriConsumerGroupMembers = (clusterId, groupId) => { - return `${apiUrl}/${clusterId}/group/${groupId}/members`; + return `${apiUrl}/${clusterId}/group/${encodeURIComponent(groupId)}/members`; }; export const uriConsumerGroupOffsets = (clusterId, groupId) => { - return `${apiUrl}/${clusterId}/group/${groupId}/offsets`; + return `${apiUrl}/${clusterId}/group/${encodeURIComponent(groupId)}/offsets`; }; export const uriConsumerGroupOffsetsByTimestamp = (clusterId, groupId, timestamp) => { - return `${apiUrl}/${clusterId}/group/${groupId}/offsets/start?timestamp=${timestamp}`; + return `${apiUrl}/${clusterId}/group/${encodeURIComponent(groupId)}/offsets/start?timestamp=${timestamp}`; }; export const uriConsumerGroupDelete = (clusterId, groupId) => { - return `${apiUrl}/${clusterId}/group/${groupId}`; + return `${apiUrl}/${clusterId}/group/${encodeURIComponent(groupId)}`; }; export const uriConsumerGroupUpdate = (clusterId, groupId) => { - return `${apiUrl}/${clusterId}/group/${groupId}/offsets`; + return `${apiUrl}/${clusterId}/group/${encodeURIComponent(groupId)}/offsets`; }; export const uriDeleteGroupOffsets = (clusterId, groupId, topicName) => { - return `${apiUrl}/${clusterId}/group/${groupId}/topic/${topicName}`; + return `${apiUrl}/${clusterId}/group/${encodeURIComponent(groupId)}/topic/${topicName}`; }; export const uriAclsList = (clusterId, search) => { @@ -274,7 +274,7 @@ export const uriAclsList = (clusterId, search) => { }; export const uriConsumerGroupAcls = (clusterId, groupId) => { - return `${apiUrl}/${clusterId}/group/${groupId}/acls`; + return `${apiUrl}/${clusterId}/group/${encodeURIComponent(groupId)}/acls`; }; export const uriConsumerGroupByTopics = (clusterId, topicList) => {