Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-23580

FOSHttpCache always matches default site with urielement matcher

    Details

      Description

      Summary:

      If using urielement matcher the site is matched against '/_fos_user_context_hash' while generating the X-User-Hash causing default site access to be used during both getting the user hash and the original request.

      Long description

      After logging in a redirect occurs and the following happens:
      1. The page is loaded from the cache via \FOS\HttpCacheBundle\HttpCache::handle
      2. The user hash header is not present yet so \FOS\HttpCacheBundle\HttpCache::handle::getUserHash is called to get it
      3. A forward request is made doing and a siteaccess match is performed during the process and stored in the router. If you are using an urlelement matcher, it is matched against '/_fos_user_context_hash'. Since this is not a valid siteaccess the default site access is used.
      4. The user hash is returned and the user hash header is updated
      5. The original request is now handled and since a site access match was made during step 3, the default siteaccess is used instead of the expected urielement matcher

        Issue Links

          Activity

          Show
          Jérôme Vieilledent (Inactive) added a comment - PR: https://github.com/ezsystems/ezpublish-kernel/pull/1067
          Show
          Jérôme Vieilledent (Inactive) added a comment - Fixed in master: https://github.com/ezsystems/ezpublish-kernel/commit/9c31418fc70cfb898c2ff3eabd55cd90e14c7b6f
          Hide
          Paulo Nunes (Inactive) added a comment -

          QA Approved
          tested on master and stable-5.4

          Show
          Paulo Nunes (Inactive) added a comment - QA Approved tested on master and stable-5.4

            People

            • Assignee:
              Unassigned
              Reporter:
              Douglas Hammond
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: