SpectoLabs / hoverfly

Lightweight service virtualization/ API simulation / API mocking tool for developers and testers
https://hoverfly.io
Apache License 2.0
2.36k stars 208 forks source link

parse form drains request body #1067

Closed kapishmalik closed 1 year ago

kapishmalik commented 1 year ago

@tommysitu could you please review this PR

Fixes #1066

we recently upgraded the Go version which has caused this. In the newer version of Go, if we do request.ParseForm then it automatically drains the request.Body. While reconstructing the request, we are sending an empty body.

https://stackoverflow.com/questions/23773183/why-does-request-parseform-drain-the-request-body https://groups.google.com/g/golang-nuts/c/mhiYjEymNDU