Problem/Motivation
The purl module overrides the router.route_provider with PurlRouteProvider, which allows it to vary the route matching in cases where a purl modifier is matched. It primarily does this by adding the purl modifier to the CID so that when a modifier is active and alters the request, it is cached separately.
The core route provider does the same thing for language and query parameters.
When a modifier is not active purl adds the path information in addition to the query string, assuming that it encompasses the data needed to match modifiers but leaves out the host information. If a host modifier is active, then this can allow bad route cache entries to be cached and cause the route information to be incorrect.
Steps to reproduce
- Enable a host modifier
- Go to a URI where the host modifier is not matched, but the route is altered.
- Go to a URI where the host modifier is matched, and the route is altered by the modifier.
- Notice that the route is loaded from cache with the first altered route.
Proposed resolution
Update getRouteCollectionForRequest to incorporate the host in it's cache. Additionally update the pattern of creating the CID to use getRouteCollectionCacheId and addExtraCacheKeyPart that have since been added.
Remaining tasks
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork purl-3593266
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
rbrandon commentedComment #3
rbrandon commentedComment #5
scottatdrake commentedLooking good to me.
Comment #6
rbrandon commented