Skip to content

Commit

Permalink
clients: set ContentLength explicitly
Browse files Browse the repository at this point in the history
Set ContentLength explicitly for net/http, so the bodies are sent in
"one piece" and not using chunked transfer encoding, when streaming
is off.

Updates #32.
  • Loading branch information
codesenberg committed Apr 10, 2018
1 parent db65d7c commit c2365fa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ func (c *httpClient) do() (

if c.body != nil {
br := strings.NewReader(*c.body)
req.ContentLength = int64(len(*c.body))
req.Body = ioutil.NopCloser(br)
} else {
bs, bserr := c.bodProd()
Expand Down

0 comments on commit c2365fa

Please sign in to comment.