Description
Using the ReceiverDemo project as an example, which supports the scheme dpl://
, registering a route with a single, variable component, e.g. : log_message
causes a false match for this route when the URL dpl://
with nothing after the scheme is opened.
This is caused by the URL having a nil
host
and a nil
path
, and not accounting for that possibility in -[DPLRouteMatcher deepLinkWithURL:]
.
The following route registration in ReceiverDemo can demonstrate the issue:
self.router[@":log_message"] = ^(DPLDeepLink *link) {
NSLog(@"%@", link[@"log_message"]);
};
With this route registered, opening the URL dpl://hello
from e.g. Mobile Safari will cause the message hello
to be logged to the console, which works as expected. However, when opening the URL dpl://
from Mobile Safari, the same route is still matched, and (null)(null)
is logged to the console.
I have a fix incoming for this.