]> Cypherpunks repositories - gostls13.git/commit
net/url: support query string without values
authorRick Arnold <rickarnoldjr@gmail.com>
Fri, 26 Feb 2016 03:24:07 +0000 (22:24 -0500)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 26 Feb 2016 16:13:26 +0000 (16:13 +0000)
commit9f26170a02327c7e03dff148faf278866a79f8b4
tree22c9e9bb323dfbe7dc2f6218cf48ee51bbc449ee
parentbdc14698f8b79e9629a8321d4f904c3275f8ffed
net/url: support query string without values

Previously, RawQuery was used to indicate the presence of a query
string in url.URL. However, this approach was not able to differentiate
between URLs that have no query string at all (http://foo.bar/) and
those that have a query with no values (http://foo.bar/?).

Add a ForceQuery field to indicate the latter form of URL and use it
in URL.String to create a matching URL with a trailing '?'.

Fixes #13488

Change-Id: Ifac663c73d35759bc6c33a00f84ab116b9b81684
Reviewed-on: https://go-review.googlesource.com/19931
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/url/url.go
src/net/url/url_test.go