Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-104348

Site virtual host doesn't work in case it has UTF-8 characters

    Details

      Description

      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

      1. Create a new site
      2. Add a test page to that site with a portlet
      3. Configure its public virtual host with ññ.example (it has UTF-8 characters)
      4. 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
      5. Open http://ññ.example:8080 in a browser:
        • Expected behavior: Home page of created site is created
        • Wrong behavior: Created site is not displayed
      6. 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"

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              summer.zhang Summer Zhang
              Reporter:
              jorge.diaz Jorge Diaz
              Participants of an Issue:
              Recent user:
              Joel Garman
              Engineering Assignee:
              Jorge Diaz
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 2 weeks, 4 days ago

                  Packages

                  Version Package
                  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