Skip to content

net/url: no Parse error with invalid port in IPv4 addresses (revert) #14860

@0xmohit

Description

@0xmohit
  1. What version of Go are you using (go version)?

    go version go1.6 linux/amd64

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

    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH=""
    GORACE=""
    GOROOT="/usr/local/go"
    GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
    GO15VENDOREXPERIMENT="1"
    CC="gcc"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
    CXX="g++"
    CGO_ENABLED="1"

  3. What did you do?
    Passed URLs containing invalid port for IPv4 and IPv6 addresses. (Ran into this while digging into net/http: empty port for ":port" causes it to default to 0 #14836)
    Playground link: http://play.golang.org/p/EG38tnEGjn

  4. What did you expect to see?
    Parse errors in both cases. Or consistent behavior.

  5. What did you see instead?
    Parse error for IPv6 address; no error for IPv4 address.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions