Skip to content

Commit

Permalink
ref: remove mappedUrl because requestUrl exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Yovach committed Oct 26, 2023
1 parent 3938144 commit 1afa929
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/next-international/src/app/middleware/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ export function createI18nMiddleware<const Locales extends readonly string[]>(co
const locale = localeFromRequest(config.locales, request, config.resolveLocaleFromRequest) ?? config.defaultLocale;

if (noLocalePrefix(config.locales, requestUrl.pathname)) {
const mappedUrl = requestUrl.clone();
mappedUrl.pathname = `/${locale}${mappedUrl.pathname}`;
requestUrl.pathname = `/${locale}${requestUrl.pathname}`;

const strategy = config.urlMappingStrategy ?? DEFAULT_STRATEGY;
if (strategy === 'rewrite' || (strategy === 'rewriteDefault' && locale === config.defaultLocale)) {
Expand Down

0 comments on commit 1afa929

Please sign in to comment.