-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Work around empty query components bug. #86
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dang! Good find
( | ||
data.path.isEmpty && data.query.isEmpty | ||
? (base ?? URL(string: "/")) | ||
: urlComponents(from: data).url(relativeTo: base) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was coming back nil
on linux, so we have to first check if path+query are empty, and if so just default to the base url.
@@ -4,6 +4,7 @@ import Either | |||
import Prelude | |||
|
|||
enum Routes { | |||
case home |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we weren't seeing this bug in the tests cause the root
route technically when to the url /home
. I've now create a separate home
route so that we can test both and fully root URL and something with path components.
I just filed this bug https://bugs.swift.org/browse/SR-6405 and this PR works around it.