summaryrefslogtreecommitdiff
path: root/src/pkg/net/url/url.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-05-02 15:44:55 +0200
committerOndřej Surý <ondrej@sury.org>2012-05-02 15:44:55 +0200
commit62e7d56f2c8706e5b88221cedac6769863ddf3b0 (patch)
treea48f46e27c9136335f8ab4db2da790556816554e /src/pkg/net/url/url.go
parent37370279cdb95edc1ebb298a957147c907907988 (diff)
parent0003ee229fd33ff46cb5f2fe1e35f5c0284debc4 (diff)
downloadgolang-62e7d56f2c8706e5b88221cedac6769863ddf3b0.tar.gz
Merge commit 'upstream/1.0.1' into debian-sid
Diffstat (limited to 'src/pkg/net/url/url.go')
-rw-r--r--src/pkg/net/url/url.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/net/url/url.go b/src/pkg/net/url/url.go
index 88ff7ebfe..b6e79adc2 100644
--- a/src/pkg/net/url/url.go
+++ b/src/pkg/net/url/url.go
@@ -61,16 +61,16 @@ func (e EscapeError) Error() string {
}
// Return true if the specified character should be escaped when
-// appearing in a URL string, according to RFC 2396.
+// appearing in a URL string, according to RFC 3986.
// When 'all' is true the full range of reserved characters are matched.
func shouldEscape(c byte, mode encoding) bool {
- // RFC 2396 §2.3 Unreserved characters (alphanum)
+ // §2.3 Unreserved characters (alphanum)
if 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' {
return false
}
- // TODO: Update the character sets after RFC 3986.
+
switch c {
- case '-', '_', '.', '!', '~', '*', '\'', '(', ')': // §2.3 Unreserved characters (mark)
+ case '-', '_', '.', '~': // §2.3 Unreserved characters (mark)
return false
case '$', '&', '+', ',', '/', ':', ';', '=', '?', '@': // §2.2 Reserved characters (reserved)