Skip to content

net/url: Parsing malformed URL does not result in error #19110

@lewisporter

Description

@lewisporter

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

go version go1.7.5 darwin/amd64

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

GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"

What did you do?

https://play.golang.org/p/qcpF1Vz3sY

What did you expect to see?

I expected the call to url.Parse() to raise an error. Otherwise, I would expect testURL.Query() to return an error, if the function signature allowed it.

What did you see instead?

testURL.Query() silently drops malformed query parameters and url.Parse() raises no error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions