airbnb / DeepLinkDispatch

A simple, annotation-based library for making deep link handling better on Android
http://nerds.airbnb.com/deeplinkdispatch/
4.37k stars 409 forks source link

Fix matching issue with placeholders #365

Closed rossbacher closed 1 year ago

rossbacher commented 1 year ago

If a match template contained a placeholder in a path element (e.g. host) and the to be matched URL element matched but was just shorter than the template (before the placeholder end) it would lead to an AIOOB Exception.

e.g.

template: scheme://{some_value(allowed|values)}somethinglonger/one/{param}/three url to match scheme://longer/one/param/three

Scheme matches host (will start to match from back) and it matches char by char bur the one in the template is longer (before the placeholder) in this case we need to avoid the AIOOB in url segment and it also does not match.