Skip to content

Commit

Permalink
Add setup ContentLength for proxyRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
xorand committed May 31, 2022
1 parent de67380 commit 2cab15f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libproxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,11 @@ func proxyHandler(response http.ResponseWriter, request *http.Request) {
contentType := fmt.Sprintf("multipart/form-data; boundary=%v", writer.Boundary())
proxyRequest.Header.Set("content-type", contentType)
proxyRequest.Body = ioutil.NopCloser(bytes.NewReader(body.Bytes()))
proxyRequest.ContentLength = int64(len(body.Bytes()))
proxyRequest.Body.Close()
} else if len(requestData.Data) > 0 {
proxyRequest.Body = ioutil.NopCloser(strings.NewReader(requestData.Data))
proxyRequest.ContentLength = int64(len(requestData.Data))
proxyRequest.Body.Close()
}

Expand Down

0 comments on commit 2cab15f

Please sign in to comment.