We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07ab125 commit 2fec54cCopy full SHA for 2fec54c
httpclient/http.go
@@ -1,6 +1,7 @@
1
package httpclient
2
3
import (
4
+ "bytes"
5
"fmt"
6
"io"
7
"net/http"
@@ -51,7 +52,11 @@ func (m *MockExecutor) Do(req *http.Request) (*http.Response, error) {
51
52
return nil, fmt.Errorf("unknown response code requested: %d", m.LockedResponseCode)
53
}
54
- response := &http.Response{StatusCode: m.LockedResponseCode, Body: nil}
55
+ response := &http.Response{
56
+ StatusCode: m.LockedResponseCode,
57
+ Body: io.NopCloser(bytes.NewBufferString("nil")),
58
+ Header: make(http.Header),
59
+ }
60
61
return response, nil
62
0 commit comments