Ignore JSON feeds from EnsureUnicode()
This commit is contained in:
parent
43ccaf52af
commit
6ae935309a
1 changed files with 5 additions and 0 deletions
|
@ -78,6 +78,11 @@ func (r *Response) EnsureUnicodeBody() (err error) {
|
|||
return mediaErr
|
||||
}
|
||||
|
||||
// JSON feeds are always in UTF-8.
|
||||
if strings.Contains(mediaType, "json") {
|
||||
return
|
||||
}
|
||||
|
||||
if strings.Contains(mediaType, "xml") {
|
||||
buffer, _ := ioutil.ReadAll(r.Body)
|
||||
r.Body = bytes.NewReader(buffer)
|
||||
|
|
Loading…
Reference in a new issue