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: '?' in userinfo is not escaped properly #6573

Closed
zombiezen opened this issue Oct 12, 2013 · 7 comments
Closed

net/url: '?' in userinfo is not escaped properly #6573

zombiezen opened this issue Oct 12, 2013 · 7 comments

Comments

@zombiezen
Copy link
Contributor

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. http://play.golang.org/p/ZLKGKTuDbS

What is the expected output?
String: http://a?@a/bar
Parsed: &url.URL{Scheme:"http", Opaque:"",
User:(*url.Userinfo)(url.User("a?")), Host:"a",
Path:"/bar", RawQuery:"", Fragment:""}

What do you see instead?
String: http://a?@a/bar
Parsed: &url.URL{Scheme:"http", Opaque:"",
User:(*url.Userinfo)(nil), Host:"a", Path:"",
RawQuery:"@a/bar", Fragment:""}

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Linux amd64

Which version are you using?  (run 'go version')
go version go1.1.2 linux/amd64
(but reproducible on tip)

Please provide any additional information below.

Attached patch fixes the issue, seems like an oversight.

Attachments:

  1. escape-userinfo.diff (533 bytes)
@zombiezen
Copy link
Contributor Author

Comment 1:

This variant on the snippet makes it a bit clearer:
http://play.golang.org/p/RARp_-9pB1

@robpike
Copy link
Contributor

robpike commented Oct 14, 2013

Comment 2:

Labels changed: added priority-later, removed priority-triage.

Owner changed to @bradfitz.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 3:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 4:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 5:

Labels changed: added repo-main.

@gopherbot
Copy link

Comment 6:

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

@bradfitz
Copy link
Contributor

Comment 7:

This issue was closed by revision 07d86b1.

Status changed to Fixed.

@ghost ghost mentioned this issue Mar 29, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
See RFC 3986 §3.2.1.
Fixes golang#6573.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/126560043
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
See RFC 3986 §3.2.1.
Fixes golang#6573.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/126560043
This issue was closed.
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

5 participants