Skip to content

Commit

Permalink
Merge pull request #50 from nazzrrg/main
Browse files Browse the repository at this point in the history
Replace http.NoBody with oohttp.NoBody in adapter
  • Loading branch information
bassosimone authored Nov 22, 2023
2 parents e944bc2 + 1cdbbee commit 221fe75
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions stdlibwrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ func (txp *StdlibTransport) RoundTrip(stdReq *http.Request) (*http.Response, err
Response: nil, // cannot assign this field
ctx: stdReq.Context(),
}

// http.NoBody is a global var with oohttp.NoBody being its analogue
// this guards against undefined content length in case when stdReq.Body == http.NoBody
if req.Body == http.NoBody {
req.Body = NoBody
}

resp, err := txp.Transport.RoundTrip(req)
if err != nil {
return nil, err
Expand Down

0 comments on commit 221fe75

Please sign in to comment.