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

Site virtual host doesn't work in case it has UTF-8 characters and doesn't start with xn--

    Details

      Description

      In LPS-104348 we added virtual hosts in UTF-8 support and we assumed that all domains encoded with punycode starts with "xn--"

      But this it is not true: in case you have a UTF-8 domain with a subdomain, each domain level is managed separately so:

      • ññ.example is encoded to xn--idaa.example

      but:

      • sub.ññ.example is encoded to sub.xn--idaa.example

      Solution: We have to replace

      virtualHostname.startsWith("xn--")

      with

      virtualHostname.contains("xn--")

      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 sub.ññ.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	sub.xn--idaa.example
      1. Open http://sub.ññ.example:8080 in a browser:
        • Expected behavior: Home page of created site is created
        • Wrong behavior: Created site is not displayed

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 26 weeks, 5 days ago

                  Packages

                  Version Package
                  7.0.0 DXP FP90
                  7.0.10.13 DXP SP13
                  7.0.X
                  7.1.10 DXP FP17
                  7.1.10.4 SP4
                  7.1.X
                  7.2.10 DXP FP4
                  7.2.X
                  7.3.0 CE GA1
                  7.3.10 DXP GA1
                  Master