Issue 9216 in go: url.Parse improperly fixes url

16 views
Skip to first unread message

g...@googlecode.com

unread,
Dec 6, 2014, 9:15:17 AM12/6/14
to golan...@googlegroups.com
Status: New
Owner: ----

New issue 9216 by apoyde...@gmail.com: url.Parse improperly fixes url
https://code.google.com/p/go/issues/detail?id=9216

What happened?
- net/url doesn't properly "correct" a malformed URL.

x, _ := url.Parse("http:/localhost:9999/a")
println(x.String()) // outputs: http:///localhost:9999/a

What should have happened instead?
- It should either output an error, or output "http://localhost:9999/a"

Playground:
https://play.golang.org/p/HkSSHIxAPW


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

g...@googlecode.com

unread,
Dec 8, 2014, 5:19:26 AM12/8/14
to golan...@googlegroups.com

Comment #1 on issue 9216 by emm.od...@gmail.com: url.Parse improperly fixes
url
https://code.google.com/p/go/issues/detail?id=9216

I have produced a patch + tests for this issue although I was going to do
this via github although the go repo got pulled inexplicably. I've never
used Google code, so have no idea how to even get reviewers to look at my
patch.

g...@googlecode.com

unread,
Dec 8, 2014, 6:36:31 AM12/8/14
to golan...@googlegroups.com

Comment #2 on issue 9216 by emm.od...@gmail.com: url.Parse improperly fixes
url
https://code.google.com/p/go/issues/detail?id=9216

Andrew Gerrand just informed me that they are in a release-freeze state so
most definitely my patch will get in in the new year. Otherwise you can
view the patch here:
https://github.com/odeke-em/go-1/compare/golang:master...master
Reply all
Reply to author
Forward
0 new messages