amannn / next-intl

🌐 Internationalization (i18n) for Next.js
https://next-intl-docs.vercel.app
MIT License
2.58k stars 236 forks source link

fix: When using `domains`, handle unknown domains more gracefully #1389

Closed amannn closed 1 month ago

amannn commented 1 month ago

When a request from an unknown host like localhost:3000 is made—as it's often the case during development—, don't try to pick a better domain when responding with redirects in the middleware. Instead, the host is now only changed for redirects if the requested host is a known one that is specified in domains.

Additionally, the port is now no longer removed automatically to determine a domain. This allows e.g. to pick different ports locally to test different locales.

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-intl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2024 2:33pm
next-intl-example-app-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2024 2:33pm
next-intl-example-app-router-without-i18n-routing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2024 2:33pm