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: Parsing of URL with a query string containing multiple question marks ? is invalid #18405

Closed
korya opened this issue Dec 21, 2016 · 2 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@korya
Copy link

korya commented Dec 21, 2016

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

https://play.golang.org

and

$ go version
go version go1.7.3 darwin/amd64

What operating system and processor architecture are you using (go env)?

$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/korya/dev/plntr/docker-images/wi-deploy"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.7.3/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.7.3/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/33/9nzx3m3n0fj7_tg1r3rdnkwc0000gn/T/go-build652538626=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

I am trying to parse a URL with a query string containing multiple question marks (?): ?a=1?b=2?c=3.

See the full example here: https://play.golang.org/p/LNpa_F9kuh

What did you expect to see?

I would expect the query string ?a=1?b=2?c=3 to be parsed the same way that ?a=1&b=2&c=3 is parsed; that is I expect to get a mapping with 3 entries: a mapped to 1, b mapped to 2 and c mapped to 3.

What did you see instead?

what I get is a map with a single entry: a mapped to 1?b=2?c=3.

@bradfitz
Copy link
Contributor

Why do you expect that?

That is not a standard URL format. What is generating those URLs? Do other popular URL parsing libraries accept this format?

@bradfitz bradfitz added this to the Unplanned milestone Dec 21, 2016
@bradfitz bradfitz added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Dec 21, 2016
@korya
Copy link
Author

korya commented Dec 21, 2016

I think you are right. I don't know why I was under impression that any additional question marks (?) inside query string should be treated as ampersands (&).

After reading https://tools.ietf.org/html/rfc3986#section-3.4, I see there is nothing that suggests it. Also other parsers behave same way that go net/url does.

My bad. I am sorry. I am closing the issue.

@korya korya closed this as completed Dec 21, 2016
@golang golang locked and limited conversation to collaborators Dec 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants