-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.1.X, Master
-
Fix Version/s: 7.0.0 DXP FP89, 7.0.10.13 DXP SP13, 7.0.X, 7.1.10 DXP FP16, 7.1.X, 7.2.10 DXP FP4, 7.2.X, 7.3.0 CE GA1, 7.3.10 DXP GA1, Master
-
Component/s: Core Infrastructure
-
Branch Version/s:7.2.x, 7.1.x, 7.0.x
-
Backported to Branch:Committed
-
Fix Priority:3
-
Git Pull Request:
Sites virtual hosts doesn't work in case they have UTF-8 characters.
Root cause of this issue is:
- We are storing virtual hosts in virtualhost table as UTF-8
- But "Host:" header that we receive from browser is encoden using Punycode (see https://www.punycoder.com/ )
As a workaround you can configure them encoded using Punycode, but the problem is all links are also written to web page using that encoding.
Solution: Create a fallback code that in case the virtualhost is not found and it starts with "xn--" try decoding it using punycode and search again using the decoded UTF-8 string
Steps to reproduce
- Create a new site
- Add a test page to that site with a portlet
- Configure its public virtual host with ññ.example (it has UTF-8 characters)
- Edit your /etc/hosts (Linux) or C:\Windows\System32\drivers\etc\hosts (Windows) file and add following line:
127.0.0.1 xn--idaa.example
- Open http://ññ.example:8080 in a browser:
- Expected behavior: Home page of created site is created
- Wrong behavior: Created site is not displayed
- Expected behavior: Home page of created site is created
- Additional check: open page source code and check the links:
- Expected behavior: All links are created with "ññ.example"
- Wrong behavior: Links are created with other domain: localhost", "127.0.0.1" or "xn--idaa.example"
- Expected behavior: All links are created with "ññ.example"
- relates
-
LPS-105241 Site virtual host doesn't work in case it has UTF-8 characters and doesn't start with xn--
- Closed
-
LPS-105242 Friendly URL are not correctly generated in case virtual host has UTF-8 characters
- Closed