Skip to content

Commit

Permalink
fix autodecode when html page is small
Browse files Browse the repository at this point in the history
  • Loading branch information
imroc committed Aug 21, 2022
1 parent fbbc61b commit 548f200
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type autoDecodeReadCloser struct {

func (a *autoDecodeReadCloser) peekRead(p []byte) (n int, err error) {
n, err = a.ReadCloser.Read(p)
if n == 0 || err != nil {
if n == 0 || (err != nil && err != io.EOF) {
return
}
a.detected = true
Expand Down
1 change: 0 additions & 1 deletion request.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ func (r *Request) SetHeader(key, value string) *Request {
r.Headers = make(http.Header)
}
r.Headers.Set(key, value)

return r
}

Expand Down

0 comments on commit 548f200

Please sign in to comment.