Skip to content

Commit

Permalink
Merge pull request #3 from thloyi/4everland
Browse files Browse the repository at this point in the history
if response has no body; set manualBodyReader=nil
  • Loading branch information
cachalots committed Nov 29, 2021
2 parents 8017665 + fad49b3 commit 886c764
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,10 @@ func (c *HostClient) doNonNilReqResp(req *Request, resp *Response) (bool, error)
return retry, err
}

if resp.Header.mustSkipContentLength() {
handlingBodyManually = false
}

shouldClose := resetConnection || req.ConnectionClose() || resp.ConnectionClose()
if handlingBodyManually {
resp.manualBodyReader = c.manualBodyReadAccessor(br, cc, shouldClose)
Expand Down

0 comments on commit 886c764

Please sign in to comment.