Skip to content

Commit

Permalink
fix(routing): default locale when there's a list
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Oct 7, 2024
1 parent d1ad249 commit 57f6657
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 0 additions & 2 deletions packages/astro/src/actions/runtime/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,9 @@ async function redirectWithResult({
if (!referer) {
throw new Error('Internal: Referer unexpectedly missing from Action POST request.');
}
console.log('redirect referer', referer);
return context.redirect(referer);
}

console.log('normal redirect', context.url.pathname);
return context.redirect(context.url.pathname);
}

Expand Down
5 changes: 1 addition & 4 deletions packages/astro/src/i18n/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ export function computeCurrentLocale(
}
} else {
if (locale.path === segment) {
const result = locale.codes.at(0);
if (result) {
return result;
}
return locale.codes.at(0);
} else {
for (const code of locale.codes) {
if (normalizeTheLocale(code) === normalizeTheLocale(segment)) {
Expand Down

0 comments on commit 57f6657

Please sign in to comment.