Do not encode dot in args

This commit is contained in:
Aliaksandr Valialkin
2015-10-22 17:48:14 +03:00
parent ff291a0679
commit bf2a91a77b
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -299,7 +299,7 @@ func unhex(c byte) int {
func appendQuotedArg(dst, v []byte) []byte {
for _, c := range v {
if c >= '0' && c <= '9' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '/' {
if c >= '0' && c <= '9' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '/' || c == '.' {
dst = append(dst, c)
} else {
dst = append(dst, '%', hexChar(c>>4), hexChar(c&15))
+1 -1
View File
@@ -29,7 +29,7 @@ func TestArgsString(t *testing.T) {
testArgsString(t, &a, "foo=bar")
testArgsString(t, &a, "foo=bar&baz=sss")
testArgsString(t, &a, "")
testArgsString(t, &a, "f%20o=xxx%D0%BF%D1%80%D0%B8%D0%B2%D0%B5aaa&sdf=ss")
testArgsString(t, &a, "f%20o=x.x/x%D0%BF%D1%80%D0%B8%D0%B2%D0%B5aaa&sdf=ss")
testArgsString(t, &a, "=asdfsdf")
}