Skip to content

Commit 2196342

Browse files
committed
fixed invalid redirect URL for no locale matching file
1 parent 597b25c commit 2196342

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Routers/PublicAPIRouter.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,11 @@ export class PublicAPIRouter extends PromiseRouter {
253253
if (config.pages.enableLocalization && locale) {
254254
return Utils.getLocalizedPath(defaultPath, locale).then(({ path, subdir }) =>
255255
redirect
256-
? this.redirectResponse(
257-
new URL(`/apps/${subdir}/${defaultFile}`, config.publicServerURL).toString(),
258-
params
259-
)
256+
? this.redirectResponse(new URL(
257+
subdir
258+
? `/apps/${subdir}/${defaultFile}`
259+
: `/apps/${defaultFile}`,
260+
config.publicServerURL).toString(), params)
260261
: this.pageResponse(path, params)
261262
);
262263
} else {

0 commit comments

Comments
 (0)