Skip to content

feat(next): Redirect next app to default locale for invalid locales#18206

Merged
david1alvarez merged 1 commit intomainfrom
FXA-10440
Jan 14, 2025
Merged

feat(next): Redirect next app to default locale for invalid locales#18206
david1alvarez merged 1 commit intomainfrom
FXA-10440

Conversation

@david1alvarez
Copy link
Copy Markdown
Contributor

Because:

  • The next app uses routing to handle locale indication, but has no rerouting fallback functionality for improper locales.

This pull request:

  • Adds functionality to the Next.js middleware to catch incoming requests to next app on routes other than: api|_next/static|_next/image|favicon.ico|heartbeat|lbheartbeat|version

Issue that this pull request solves

Closes FXA-10440

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).

Comment thread apps/payments/next/middleware.ts Outdated
Copy link
Copy Markdown
Contributor

@StaberindeZA StaberindeZA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+wc

Comment thread apps/payments/next/middleware.ts Outdated
Comment thread apps/payments/next/middleware.ts Outdated
@david1alvarez david1alvarez changed the title feat(next): Redirect next app to en-US locale for invalid locales feat(next): Redirect next app to default locale for invalid locales Jan 14, 2025
Because:

* The next app uses routing to handle locale indication, but has no rerouting fallback functionality for improper locales.

This commit:

* Adds functionality to the Next.js middleware to catch incoming requests to next app on routes other than: api|_next/static|_next/image|favicon.ico|__heartbeat__|__lbheartbeat__|__version__

Closes FXA-10440
@david1alvarez david1alvarez merged commit a938746 into main Jan 14, 2025
@david1alvarez david1alvarez deleted the FXA-10440 branch January 14, 2025 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants