Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

amannn
Copy link
Owner

@amannn amannn commented Oct 1, 2024

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.

Copy link

vercel bot commented Oct 1, 2024

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

@amannn amannn marked this pull request as ready for review October 1, 2024 13:59
@amannn amannn changed the title fix: When using domains in routing config, handle unknown domains more gracefully in middleware fix: When using domains in routing config, handle unknown domains like localhost:3000 more gracefully in middleware Oct 1, 2024
@amannn amannn merged commit 2fb56b1 into canary Oct 1, 2024
6 of 7 checks passed
@amannn amannn mentioned this pull request Oct 1, 2024
@amannn amannn changed the title fix: When using domains in routing config, handle unknown domains like localhost:3000 more gracefully in middleware fix: When using domains, handle unknown domains more gracefully in middleware Oct 1, 2024
@amannn amannn changed the title fix: When using domains, handle unknown domains more gracefully in middleware fix: When using domains, handle unknown domains more gracefully Oct 2, 2024
@amannn amannn deleted the fix/middleware-domains-unknown branch October 24, 2024 13: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.

1 participant