mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-04 17:16:01 +00:00
fix: normalize admin basepath to prevent double slashes in URLs
Strip trailing slashes from adminBasepath in AdminController window context and wouter Router base to prevent paths like /admin//data when users configure adminBasepath with a trailing slash. Amp-Thread-ID: https://ampcode.com/threads/T-019ca537-4cc4-7174-bf9a-5325d782f097 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -33,7 +33,7 @@ export function Routes({
|
||||
}) {
|
||||
const { theme } = useTheme();
|
||||
const ctx = useBkndWindowContext();
|
||||
const actualBasePath = basePath || ctx.admin_basepath;
|
||||
const actualBasePath = (basePath || ctx.admin_basepath).replace(/\/+$/, "");
|
||||
|
||||
return (
|
||||
<div id="bknd-admin" className={theme + " antialiased"}>
|
||||
|
||||
Reference in New Issue
Block a user