diff options
author | Frédéric Guillot <fred@miniflux.net> | 2019-12-26 15:26:23 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2019-12-26 15:56:59 -0800 |
commit | 3debf75eb9229144a05701e03ba59408a75dd815 (patch) | |
tree | 9e9eb6569db3234b514f798d4278b20793b79833 /http/client/response_test.go | |
parent | 200b1c304b999191a29f36d4122e7aa05481125c (diff) |
Normalize URL query string before executing HTTP requests
- Make sure query strings parameters are encoded
- As opposed to the standard library, do not append equal sign
for query parameters with empty value
- Strip URL fragments like Web browsers
Diffstat (limited to 'http/client/response_test.go')
-rw-r--r-- | http/client/response_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/http/client/response_test.go b/http/client/response_test.go index 818fd81..6a2d8c2 100644 --- a/http/client/response_test.go +++ b/http/client/response_test.go @@ -95,7 +95,7 @@ func TestToString(t *testing.T) { input := `test` r := &Response{Body: strings.NewReader(input)} - if r.String() != input { + if r.BodyAsString() != input { t.Error(`Unexpected ouput`) } } @@ -140,7 +140,7 @@ func TestEnsureUnicodeWithHTMLDocuments(t *testing.T) { t.Fatalf(`Unicode conversion error for %q - %q: %v`, tc.filename, tc.contentType, parseErr) } - isUnicode := utf8.ValidString(r.String()) + isUnicode := utf8.ValidString(r.BodyAsString()) if isUnicode != tc.convertedToUnicode { t.Errorf(`Unicode conversion %q - %q, got: %v, expected: %v`, tc.filename, tc.contentType, isUnicode, tc.convertedToUnicode) |