Skip to content

Commit

Permalink
Merge pull request #4 from sonirico/fix/unwanted-chunked-request
Browse files Browse the repository at this point in the history
fix: prevent chunked requests
  • Loading branch information
sonirico authored Sep 22, 2022
2 parents 4277b13 + b079166 commit 576e6ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions adapter_fasthttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func (a *fastHttpReqAdapter) SetBodyStream(body io.ReadWriteCloser, bodySize int

func (a *fastHttpReqAdapter) SetBody(body []byte) {
a.req.SetBody(body)
a.req.Header.SetContentLength(len(body))
}

func (a *fastHttpReqAdapter) Body() (bts []byte) {
Expand Down
1 change: 1 addition & 0 deletions adapter_native.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (a *nativeReqAdapter) SetBody(payload []byte) {
// TODO: pool these readers
a.body = closableReaderWriter{ReadWriter: bytes.NewBuffer(payload)}
a.req.Body = a.body
a.req.ContentLength = int64(len(payload))
}

func (a *nativeReqAdapter) Body() []byte {
Expand Down

0 comments on commit 576e6ab

Please sign in to comment.