Skip to content

net/url: no way to parse absolute URLs #16822

@ThomasHabets

Description

@ThomasHabets

#1. What version of Go are you using (go version)?

go version go1.7 linux/arm
#2. What operating system and processor architecture are you using (go env)?

GOARCH="arm"
GOBIN=""
GOEXE=""
GOHOSTARCH="arm"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/blaha/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_arm"
CC="gcc"
GOGCCFLAGS="-fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build859569037=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

#3. What did you do?

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

"cache_object" scheme is used by the squid proxy.
#4. What did you expect to see?

RFC3986 section 3.1:

   When presented with a URI that violates one or more scheme-specific
   restrictions, the scheme-specific resolution process should flag the
   reference as an error rather than ignore the unused parts; doing so
   reduces the number of equivalent URIs and helps detect abuses of the
   generic syntax, which might indicate that the URI has been
   constructed to mislead the user (Section 7.6).

I expect to get an error. I.e. for the play.golang.org snippet to panic.
#5. What did you see instead?

"Path" is set to the whole input.

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