fix(cmp): tolerate variable URL segments in ePaaS policy pattern
BMW ePaaS URLs use 3 segments between /policypage/ and .epaas.json: /epaas/prod/policypage/<tenant>/<config-hash>/<locale>.epaas.json The old pattern only matched 2 segments. Switch to a tolerant pattern that matches any path before .epaas.json (anchored at .epaas.json end).
This commit is contained in:
@@ -32,7 +32,9 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
# URL patterns that identify a CMP policy JSON. Order matters — first match wins.
|
||||
_MATCHERS: list[tuple[str, re.Pattern[str]]] = [
|
||||
("epaas", re.compile(r"/epaas/prod/policypage/[^/]+/[^/]+\.epaas\.json", re.I)),
|
||||
# BMW ePaaS: /epaas/prod/policypage/<tenant>/<config>/<locale>.epaas.json
|
||||
# Use a tolerant pattern: any number of segments before .epaas.json
|
||||
("epaas", re.compile(r"/epaas/prod/policypage/.+\.epaas\.json(\?|$)", re.I)),
|
||||
("onetrust", re.compile(r"cdn\.cookielaw\.org/consent/[^/]+/[^/]+\.json", re.I)),
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user