Skip to content

Commit

Permalink
fix: bad leading slash on empty basePath
Browse files Browse the repository at this point in the history
  • Loading branch information
cmmoran committed Dec 2, 2023
1 parent ea1da66 commit 13f4be0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/next-edge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,12 @@ export function createApiHandler(options: CreateApiHandlerOptions) {
const url = `${baseUrl}/${path}?${search.toString()}`
const basePathNoLeadingSlash =
basePath.length > 1 ? basePath.substring(1) : ""
const welcomeArray =
basePathNoLeadingSlash.length === 0
? ["ui", "welcome"]
: [basePathNoLeadingSlash, "ui", "welcome"]

if (path === `${[basePathNoLeadingSlash, "ui", "welcome"].join("/")}`) {
if (path === `${welcomeArray.join("/")}`) {
// A special for redirecting to the home page
// if we were being redirected to the hosted UI
// welcome page.
Expand Down

0 comments on commit 13f4be0

Please sign in to comment.