-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add support for question marks in hash fragments #36
Conversation
From [rfc3986](https://tools.ietf.org/html/rfc3986#section-3.5): > The characters slash ("/") and question mark ("?") are allowed to > represent data within the fragment identifier.
CLA is valid! |
Hi, is someone available to take a look at this? It addresses a fairly troublesome bug. |
Sorry for the late response @gigabo. Code changes look ok to me. 👍 |
|
||
// Leave `pos` at the beginning of the query-string, if any. | ||
['#', '?'].forEach(function(delimiter){ | ||
pos = url.indexOf(delimiter); |
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.
thanks @gigabo for the fix! would it be better to use pos = path.indexOf(delimiter)
? Sorry for the delay in response, for some reason, I did not get notification of your PR :(
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.
Hi @lingyan. Nice catch. I've pushed a patch.
Great, @gigabo Once build passes, I will merge and release. Thanks a lot for your contribution! |
@gigabo New version 2.0.2 has been released and published to npm, with your fix: https://github.com/yahoo/routr/releases/tag/v2.0.2 |
Thanks! |
URLs with no query string, but with a hash fragment containing
?
have the portion of the hash fragment prior to the?
erroneously included as part of the path.For example, given
/foo#bar?baz
, the path should be/foo
, but is instead/foo#bar
.From rfc3986: