From 5e8291c7338dbe2ba7308cfac5c27966d7e64460 Mon Sep 17 00:00:00 2001 From: Aashish Sharma Date: Fri, 5 Jun 2026 12:37:38 +0530 Subject: [PATCH] mgr/dashboard: Fix username validation for special characters by URL-encoding user lookup requests When validating usernames, special characters such as '#' were not being URL-encoded before being appended to the user lookup endpoint. Because the browser treats '#' as a URL fragment, the request path was truncated, causing the backend to return an incorrect response and the UI to display a misleading "User already exists" validation error. Fixes: https://tracker.ceph.com/issues/77129 Signed-off-by: Aashish Sharma (cherry picked from commit b2ed52b2a4d86ad6fa19851053badfa9118c4b6f) --- .../mgr/dashboard/frontend/src/app/shared/api/user.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/user.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/user.service.ts index 95c80dd4665..d432e318471 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/user.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/user.service.ts @@ -21,7 +21,7 @@ export class UserService { } get(username: string) { - return this.http.get(`api/user/${username}`); + return this.http.get(`api/user/${encodeURIComponent(username)}`); } create(user: UserFormModel) { -- 2.47.3