Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Don't use urlsplit on request path #260
This leads to things like:
Which means we accidentally drop
A request such as:
Is perfectly valid. Non-sensical maybe, but perfectly valid.
@mmerickel there is no whole URL when parsing a
However, the following is ALSO a legal
This form is only ever used when the server is a proxy server, and it is not likely to exist in the wild. But that means both cases do need to get handled.
As for it being a scheme relative URL, it is not, the URL that was accessed by the client was:
Which gets turned into this by curl and friends:
It was 02:15 in the morning when I first found the issue and added this issue to the issue tracker. I realize that I had a bunch of additional context in my head that was not in the issue. Sorry for not making it more clear.
The issue here is that we crack the first line, and then pass that uri from that to urlsplit. If we are a proxy server then that makes sense, because we will get a full URL and urlsplit will do its magic correctly. If however we have just a path + query string, then urlsplit fails miserably when the path starts with two
Basically this needs to change to: