Merge pull request #11 from gringofe/body-crash-fix

fixes issue #7 by directly assigning body data to proxyRequest.Body
This commit is contained in:
John Harker 2020-01-17 16:44:06 -06:00 committed by GitHub
commit 11a6f96857
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -138,9 +138,8 @@ func proxyHandler(response http.ResponseWriter, request *http.Request) {
}
if(len(requestData.Data) > 0) {
var proxyRequestBody []byte;
proxyRequestBody, err = ioutil.ReadAll(strings.NewReader(requestData.Data));
_, err = proxyRequest.Body.Read(proxyRequestBody);
proxyRequest.Body = ioutil.NopCloser(strings.NewReader(requestData.Data));
proxyRequest.Body.Close();
}
var client http.Client;