-
Notifications
You must be signed in to change notification settings - Fork 41
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
Rejected Navigation Data Arrays with Blank Items #154
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The error comes when the link's built instead of when it's parsed. This is a change but I don't think it matters? Have to reject empty array items. Arguably could reject blank crumblessUrl earlier - when state context built? But it's v obscure so not worth it
If the array was ['a', ''] then routePath would be a/, but it should be a// to generate blank item when parsed. Now blank items aren't allowed this code isn't needed
The toString() check was meant to block empty strings and empty arrays, but it also blocks [''] because [''].toString() is ''
Removed crumblessCheck in StateHandler now converter handles empty crumblessUrl e.g. r?crumb= If the url was r?crumb=r&crumb= then this goes into the array vals validation instead of array string and converter already throws error
The crumb urls will always being with / even if the crumbless ones don't because they're built not passed in. For safety's sake, prepended / onto crumbless ones in case someone accesses them directly
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A route of {*x} and navigation data of ['', 'jsfiddle.net'] generated //jsfiddle.net, which equals https://jsfiddle.net. Fixed #153 by rejecting navigation data arrays with blank (null, undefined or '') items.