Fix login webui fail
WebUI cannot login cause by 38221509e6cc06a6897e8b9b2aa049a70c033840.
The root URL ("/") represents the top-level directory of a website.
Removing the trailing slash from the root URL could lead to incorrect
representations.
Therefore, add to check that the URL is not the root before removing the
trailing slash.
Fixes #279
Tested: Use Chrome to access
https://${BMC_IP}.
Success login WebUI.
Change-Id: I19527ee785f550ba5aeafe6e94e8521ab508817c
Signed-off-by: VinceChang6637 <vince_chang@aspeedtech.com>
diff --git a/include/authentication.hpp b/include/authentication.hpp
index 215e464..e6e699c 100644
--- a/include/authentication.hpp
+++ b/include/authentication.hpp
@@ -218,7 +218,7 @@
{
// Handle the case where the router registers routes as both ending with /
// and not.
- if (url.ends_with('/'))
+ if (url.ends_with('/') && url != "/")
{
url.remove_suffix(1);
}