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

[Routing] Output IDN domains instead of punycode for UrlGeneratorInterface::ABSOLUTE_URL #54825

Open
ThomasLandauer opened this issue May 2, 2024 · 0 comments
Labels

Comments

@ThomasLandauer
Copy link
Contributor

Description

I have an IDN domain (e.g. exämple.com) with nginx.

  • When I put the punycode domain in nginx config (server_name xn--...), as recommended at http://nginx.org/en/docs/http/server_names.html#idn then $router->generate(..., ..., UrlGeneratorInterface::ABSOLUTE_URL); outputs the punycode url: ttps://xn--...
  • When I put the IDN in nginx config (server_name exämple.com), then routing isn't working at all and I get the "Welcome to Symfony 7" page.

Internally, the router is using Request::getHost(), which uses PHP's $_SERVER['SERVER_NAME'].

So I'm suggesting to run absolute URL's through idn_to_ascii() by default, or add a flag for that. Nobody who has an IDN domain wants to show the punycode version to the users ;-)

Or am I missing something here?

Example

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants