Skip to content
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

net/url: Trailing question marks in query string appears to be misparsed #14573

Closed
bjkail opened this issue Feb 29, 2016 · 2 comments
Closed
Milestone

Comments

@bjkail
Copy link

bjkail commented Feb 29, 2016

Commit 9f26170 from issue #13488 appears to improperly parse URLs if the query string ends in ?, such as http://host/?q=?. I noticed through code inspection, so I don't have a way to verify and so this issue might be invalid. The current playground seems to behave correctly: http://play.golang.org/p/khxLopsBd0

@dghubble
Copy link

dghubble commented Mar 1, 2016

I noticed this in some test logs as well. Following 9f26170, http.NewRequest fails to create a http.Request for a test URL ending in "?", due to the url.Parse change.

_, err := http.NewRequest("GET", "http://a.io?mac=?", nil)
fmt.Println(err)

Output

&url.Error{Op:"parse", URL:"http://a.io?mac=?", Err:"?"}

I expected url.Parse to parse the URL ending in "?".

@gopherbot
Copy link

CL https://golang.org/cl/20116 mentions this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants