Skip to content

net/url: Parsing of URL with a query string containing multiple question marks ? is invalid #18405

@korya

Description

@korya

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions