You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In thinking about my problem outlined in #102, I had the idea to break it into two routers, where the first only matches on scheme and host and ignores the rest. But I ran into trouble, because when using that to match a whole URL it fails to match due to the presence of the path, query, and any other components of the URL.
It seemed like Rest() might be a good fit, however this seems designed to work with something iterable, which URLRequestData is not ("Generic struct 'Rest' requires that 'URLRequestData' conform to 'Collection'"). I also looked at Skip and a few other ideas but could not find anything that worked.
Example router:
OneOf{Route(.case(RootRoute.universalLink)){OneOf{Scheme("http")Scheme("https")}Host("www.example.com")
// What goes here to ignore everything else?
}
/// Legacy deep links
Route(.case(RootRoute.legacyDeepLink)){Scheme("myapp")Host("preview")
// What goes here to ignore everything else?
}}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In thinking about my problem outlined in #102, I had the idea to break it into two routers, where the first only matches on scheme and host and ignores the rest. But I ran into trouble, because when using that to match a whole URL it fails to match due to the presence of the path, query, and any other components of the URL.
It seemed like
Rest()
might be a good fit, however this seems designed to work with something iterable, which URLRequestData is not ("Generic struct 'Rest' requires that 'URLRequestData' conform to 'Collection'"). I also looked atSkip
and a few other ideas but could not find anything that worked.Example router:
Beta Was this translation helpful? Give feedback.
All reactions