Skip to content

Commit

Permalink
Fixed: remove race around bodyCloser when no content (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Powers committed Aug 12, 2019
1 parent 5a93585 commit 6ac761d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion maniphttp/manipulator.go
Expand Up @@ -739,7 +739,13 @@ func (s *httpManipulator) send(

// If we have content, we return the response.
// The body will be drained by the defered call to closeCurrentBody().
if response.StatusCode == http.StatusNoContent || response.ContentLength == 0 || dest == nil {
if response.StatusCode == http.StatusNoContent || response.ContentLength == 0 {
bodyCloser = nil

return response, nil
}

if dest == nil {
return response, nil
}

Expand Down

0 comments on commit 6ac761d

Please sign in to comment.