New upstream version 0.0~git20160726.0.5bd2802
Anthony Fok
7 years ago
0 | |
urlesc [![Build Status](https://travis-ci.org/opennota/urlesc.png?branch=master)](https://travis-ci.org/opennota/urlesc) [![GoDoc](http://godoc.org/github.com/opennota/urlesc?status.svg)](http://godoc.org/github.com/opennota/urlesc)
|
|
0 |
urlesc [![Build Status](https://travis-ci.org/PuerkitoBio/urlesc.png?branch=master)](https://travis-ci.org/PuerkitoBio/urlesc) [![GoDoc](http://godoc.org/github.com/PuerkitoBio/urlesc?status.svg)](http://godoc.org/github.com/PuerkitoBio/urlesc)
|
1 | 1 |
======
|
2 | 2 |
|
3 | 3 |
Package urlesc implements query escaping as per RFC 3986.
|
|
7 | 7 |
|
8 | 8 |
## Install
|
9 | 9 |
|
10 | |
go get github.com/opennota/urlesc
|
|
10 |
go get github.com/PuerkitoBio/urlesc
|
11 | 11 |
|
12 | 12 |
## License
|
13 | 13 |
|
14 | |
MIT
|
|
14 |
Go license (BSD-3-Clause)
|
15 | 15 |
|
59 | 59 |
|
60 | 60 |
case encodeFragment: // ยง4.1
|
61 | 61 |
// The RFC text is silent but the grammar allows
|
62 | |
// everything, so escape nothing.
|
63 | |
return false
|
|
62 |
// everything, so escape nothing but #
|
|
63 |
return c == '#'
|
64 | 64 |
}
|
65 | 65 |
}
|
66 | 66 |
|
337 | 337 |
},
|
338 | 338 |
"",
|
339 | 339 |
},
|
340 | |
// unescaped : / ? # [ ] @ ! $ & ' ( ) * + , ; = in fragment
|
341 | |
{
|
342 | |
"http://example.com/#:/?#[]@!$&'()*+,;=",
|
|
340 |
// unescaped : / ? [ ] @ ! $ & ' ( ) * + , ; = in fragment
|
|
341 |
{
|
|
342 |
"http://example.com/#:/?%23[]@!$&'()*+,;=",
|
343 | 343 |
&url.URL{
|
344 | 344 |
Scheme: "http",
|
345 | 345 |
Host: "example.com",
|