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

Capitalization in Virtual Hostname results in misses in VirtualHost table

Description

    When saving an entry to the VirtualHost table by giving a LayoutSet virtual hostname, capitalization is saved in the DB, which is incorrect.  Hostnames should be lowercase.  This results in missed fetches, since the portal always fetches lowercase, but the entries are saved with capitalization.

    Steps to reproduce:

    1. Modify hosts file to include at least two new hosts, "liferay-lower" and "LIFERAY-UPPER"
    2. Create two new sites with a public widget page on each.
    3. For each site, go to Configuration > Site Settings > Site Configuration > Site URL
    4. For one site, change the "Virtual Host" value to "liferay-lower".  The other site, use "LIFERAY-UPPER".
    5. In a new tab, visit http://liferay-lower:8080 or http://LIFERAY-LOWER:8080 (capitalization should not matter in URLs)
    6. Verify you are taken directly to the site's default public page as specified in step 4.
    7. In a new tab, visit http://liferay-upper:8080 or http://LIFERAY-UPPER:8080.

    Expected Results: Portal redirects to site created in step 4

    Actual Results: Portal redirects to default site and page, like when using localhost

     

    Bonus bug: The same virtual hostname can be used in multiple layoutsets or virtual instances as long as the capitalization is different.  This goes against our unique hostname constraint, at least in the functional aspect.

     

    Reproduced in master: 62f3e2f73e7ac48f81c19bc25e9396abc1004044

    Attachments

      Activity

        People

          kevin.valencia Kevin Valencia
          christopher.kian Christopher Kian
          Brian Wulbern Brian Wulbern
          Christopher Kian Christopher Kian
          Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

            Created:
            Updated:
            Resolved:
            25 weeks, 2 days ago

            Packages

              Version Package
              7.4.3.44 CE GA44
              7.4.3.45 CE GA45
              Master