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

CORS error when site virtualhost is a subdomain of portal virtualhost



      In case we are using a virtualhost in a site, and that virtualhost is a subdomain of the portal domain, if we access to that site vía the friendlyURL instead of the virtualhost, we'll see a CORS error in the moment of adding a new portlet, check portlet configuration, etc.

      Steps to reproduce
      1.- Start Master
      2.- Add a new instance with the virtualhost "my-instance.com".
      3.- Access to the new instance.
      4.- Create 2 sites:
      4.a.- One called "newdomain" with virtualhost (SiteURL --> Public Pages): "newdomain.com"
      4.b.- Other called "subdomain" with virtualhost (SiteURL --> Public Pages): "subdomain.my-instance.com"
      5.- Add just a welcome page in every site.
      6.- Access to the FriendlyURLs of both sites (my-instance.com:8080/web/newdomain and my-instance.com:8080/web/subdomain) and try to add a Web Content Display

      Expected behaviour
      You can add it in both sites

      Actual behaviour
      You can add it in "newdomain" but not in "subdomain". If you open the browser console you'll see CORS error.

      Additional Notes
      If you 'inspect' the plus button to add a new portlet, you can see the link is pointing to is: subdomain.my-instance.com:8080/... even when you are accessing through my-instance.com:8080/web/subdomain which is the reason of the CORS error.


          Issue Links



              • Votes:
                0 Vote for this issue
                1 Start watching this issue


                • Created:
                  Days since last comment:
                  2 years, 48 weeks, 6 days ago


                  Version Package
                  6.2.X EE
                  7.0.0 DXP FP10
                  7.0.0 DXP SP2
                  7.0.3 CE GA4