Encode realm name in URL when fetching from ui-ext (#28703)

Closes #28702

Signed-off-by: jchong <jhchong92@gmail.com>
This commit is contained in:
jhchong92 2024-04-14 23:51:26 +08:00 committed by GitHub
parent 4672366eb9
commit dbd016d4ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,8 +11,12 @@ export async function fetchAdminUI<T>(
const baseUrl = adminClient.baseUrl;
const response = await fetchWithError(
joinPath(baseUrl, "admin/realms", adminClient.realmName, endpoint) +
(query ? "?" + new URLSearchParams(query) : ""),
joinPath(
baseUrl,
"admin/realms",
encodeURIComponent(adminClient.realmName),
endpoint,
) + (query ? "?" + new URLSearchParams(query) : ""),
{
method: "GET",
headers: getAuthorizationHeaders(accessToken),