[MULTISITE-166] NotEmptyUriPrefixMatcher only matches Uri-Prefix with incorrect "startWith" Created: 12/Dec/22  Updated: 12/Dec/22

Status: Open
Project: Magnolia Multisite Module
Component/s: None
Affects Version/s: 2.1.2
Fix Version/s: None

Type: Bug Priority: High
Reporter: Sebastian Mohr Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2022-12-12-15-01-08-118.png     PNG File image-2022-12-12-15-01-34-075.png     PNG File image-2022-12-12-15-14-00-805.png     PNG File image-2022-12-12-15-15-50-498.png    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

Steps to reproduce

  1. Go to Demo Author https://demoauthor.magnolia-cms.com/.magnolia/admincentral
  2. Duplicate Site "travel" and rename duplication to "travel-destination"
  3. Change Theme to "sportstation-theme" in Site "travel-destination"
  4. Change Mapping URI Prefix to "/dest" and handlePrefix to "/travel/destination"  in Site "travel-destination"

Expected results

https://travel-demo.magnolia-cms.com/dest shows Destination-Page with Sportstation Header

https://travel-demo.magnolia-cms.com/destination shows Destination-Page with Travel Header

Actual results

https://travel-demo.magnolia-cms.com/dest shows Destination-Page with Sportstation Header

https://travel-demo.magnolia-cms.com/destination shows Error

Workaround

-

Development notes

info.magnolia.multisite.sites.matchers.NotEmptyUriPrefixMatcher matches UriPrefix in multiple places with startWith

It should match either if uri is only uriPrefix itself or uri starts with uriPrefix as path, e.g. in described example it should only match if uri is "/dest" or "/dest/" only or starts with "/dest/" with further path


Generated at Mon Feb 12 06:07:01 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.