-
Notifications
You must be signed in to change notification settings - Fork 637
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
Fix empty path parsing #418
Conversation
It does look more correct but I am unsure what to do with the path. If I am not mistaken here the end result is that the path will be Also, don't we have the same issue with the fragment ( Finally I see this code attempts to support HTTP path parameters ( |
Yes, the path will be I didn't check if the fragment has the same issue, but I can do that. |
Yes, the same issue applied to fragments and I just fixed it the same way. I'm still hesitant to make path an empty string since I don't know what downstream usage might look like right now. Perhaps somebody is testing if a path exists by evaluating the path attribute for truthyness. |
@alerque I agree re. keeping the path I still think we should delete the code parsing path parameters. This style of path parameters comes from long deprecated RFC 1808 and is not used in modern HTTP, semicolons are a normal character (and here it may also cause issues with path parsing). |
imho for all elements, path, fragment, etc, this test must hold; assert(uri == url.build(url.parse(uri))) Exceptions;
So for |
@Tieske That's the way it works right now and we're not changing that, an empty string @catwell I agree, but I think that should be in a separate PR as it is a much more involved fix & possibly breaking change. I'll get the party started with one after this merge and we can talk about the details there. It's part of the builder and other logic too. |
Fixes #417.
How does this fix look? Simplistic but more valid than the current parsing I think.