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: Use correct port for alternate links when running behind a proxy… #514

Merged
merged 4 commits into from
Sep 21, 2023

Conversation

iza-w
Copy link
Contributor

@iza-w iza-w commented Sep 20, 2023

When the application runs behind a proxy, the x-forwarded-host header contains the correct host and port information. However, the port in the request.url may not match the actual port used by the proxy. By overriding the port with an empty string, we ensure that alternate links are generated correctly, reflecting the proxy's host and eliminating potential inconsistencies.

@vercel
Copy link

vercel bot commented Sep 20, 2023

@iza-w is attempting to deploy a commit to the next-intl Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Sep 20, 2023

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 Sep 21, 2023 1:24pm
next-intl-example-next-13 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 21, 2023 1:24pm

Copy link
Owner

@amannn amannn left a comment

Choose a reason for hiding this comment

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

Great point, thank you so much for this PR @iza-w!

I took the liberty to add another test and tweak the handling slightly.

Will merge this as soon as CI is green.

@amannn amannn merged commit 747ad5b into amannn:main Sep 21, 2023
5 checks passed
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.

2 participants