]> Cypherpunks repositories - gostls13.git/commit
net/url: generate correct Path when hostname empty
authorAndrew Gerrand <adg@golang.org>
Wed, 23 Jan 2013 00:37:06 +0000 (11:37 +1100)
committerAndrew Gerrand <adg@golang.org>
Wed, 23 Jan 2013 00:37:06 +0000 (11:37 +1100)
commitcdd6ae128894abbaf3fef0401cdef319f3ec1d3d
tree59a655d6d899ca4f2dc80fa30813462b48a916e0
parent9413a6f660738708a321d2806236143e5e189901
net/url: generate correct Path when hostname empty

Parse("file:///foo") previously returned a URL with Scheme "file"
and Path "///foo". Now it returns a URL with Path "/foo",
such that
        &URL{Scheme: "file", Path: "/foo"}.String() == "file:///foo"

This means that parsing and stringifying the URL "file:/foo"
returns "file:///foo", technically a regression but one that only
affects a corner case.

Fixes #4189.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/7135051
src/pkg/net/url/url.go
src/pkg/net/url/url_test.go