Skip to content
Permalink
Browse files

protect against consumers of Assert draining response body

  • Loading branch information...
steinfletcher committed Apr 19, 2019
1 parent 40876e9 commit 83f5a25a496740539a20d36535c761252f460f5d
Showing with 2 additions and 1 deletion.
  1. +2 −1 apitest.go
@@ -544,7 +544,8 @@ func (a *APITest) run() {
func (a *APITest) assertFunc(res *httptest.ResponseRecorder, req *http.Request) error {
if len(a.response.assert) > 0 {
for _, assertFn := range a.response.assert {
err := assertFn(res.Result(), req)
response := res.Result()
err := assertFn(copyHttpResponse(response), req)
if err != nil {
return err
}

0 comments on commit 83f5a25

Please sign in to comment.
You can’t perform that action at this time.