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/http: post to malformed URL gives wrong error #4271
Labels
Milestone
Comments
I wonder if I really meant http:/// or http:// (three or two slashes). With three slashes it is clearly net/http's fault - no host at all. With two slashes it should say tcp Users:443, which I think it would. So I am assuming this bug is the 3-slash problem, which is not net's. It might be in url instead of http. |
It seems to me the issue here is in net/url. RFC 3986 Section 3.2.2 (http://tools.ietf.org/html/rfc3986#section-3.2.2) states: If the URI scheme defines a default for host, then that default applies when the host subcomponent is undefined or when the registered name is empty (zero length). For example, the "file" URI scheme is defined so that no authority, an empty host, and localhost" all mean the end-user's machine, whereas the "http" scheme considers a missing authority or empty host invalid. So if the scheme is http or https and we have 3-slashes, we have a missing host, so we should be returning an error from url.Parse I'd be happy to submit a patch if you agree. |
This issue was updated by revision f85b94a. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6931052 |
rsc
added
fixed
Suggested
Issues that may be good for new contributors looking for work to do.
labels
Dec 13, 2012
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
The text was updated successfully, but these errors were encountered: