Fixes internal routing of URLs with query strings #217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Given the above app being served from
localhost
(with history-api-fallback behavior). If you were to visit the URLhttp://localhost:8080/some/path?query=0
everything would work as expected:/:a/:b
fromlocation.pathname
on startup and render the view.You would be able to see a button. Clicking on the button fires
a.router.go
which gets passed a URL in the same form as the one matched on startup.. this time:This is because when the page loads
router.match
gets passed thepathname
part of the current URL (which evaluates to/some/path
) whereasrouter.go
tries to match the string it is passed without parsing out thepathname
part (/other/path?query=1
instead of/other/path
).This PR is trying to ensure only the
pathname
part of a URL passed torouter.go
gets passed torouter.match
so that you can internal route to URLs with query parameters.