]> Cypherpunks repositories - gostls13.git/commit
net/url: cleaned up URL interface (v2)
authorGustavo Niemeyer <gustavo@niemeyer.net>
Tue, 17 Jan 2012 02:49:05 +0000 (00:49 -0200)
committerGustavo Niemeyer <gustavo@niemeyer.net>
Tue, 17 Jan 2012 02:49:05 +0000 (00:49 -0200)
commitdafd9f0bfc4ef33845bc8c370e3a6bc48b39d793
tree51c6b102d0ac408441e23789f078f85e4bc30dc2
parenta5aa4d3307ccc557127d333b7b084b52d5097979
net/url: cleaned up URL interface (v2)

Duplicated fields from URL were dropped so that its behavior
is simple and expected when being stringified and when being
operated by packages like http. Most of the preserved fields
are in unencoded form, except for RawQuery which continues to
exist and be more easily handled via url.Query().

The RawUserinfo field was also replaced since it wasn't practical
to use and had limitations when operating with empty usernames
and passwords which are allowed by the RFC. In its place the
Userinfo type was introduced and made accessible through the
url.User and url.UserPassword functions.

What was previous built as:

        url.URL{RawUserinfo: url.EncodeUserinfo("user", ""), ...}

Is now built as:

        url.URL{User: url.User("user"), ...}

R=rsc, bradfitz, gustavo
CC=golang-dev
https://golang.org/cl/5498076
13 files changed:
src/pkg/net/http/cgi/host.go
src/pkg/net/http/client.go
src/pkg/net/http/httputil/dump.go
src/pkg/net/http/httputil/reverseproxy.go
src/pkg/net/http/readrequest_test.go
src/pkg/net/http/request.go
src/pkg/net/http/requestwrite_test.go
src/pkg/net/http/serve_test.go
src/pkg/net/http/transport.go
src/pkg/net/url/url.go
src/pkg/net/url/url_test.go
src/pkg/websocket/hixie.go
src/pkg/websocket/hybi.go