Skip to content

Commit 2fec54c

Browse files
committed
more mock bugfixes
1 parent 07ab125 commit 2fec54c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

httpclient/http.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package httpclient
22

33
import (
4+
"bytes"
45
"fmt"
56
"io"
67
"net/http"
@@ -51,7 +52,11 @@ func (m *MockExecutor) Do(req *http.Request) (*http.Response, error) {
5152
return nil, fmt.Errorf("unknown response code requested: %d", m.LockedResponseCode)
5253
}
5354

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+
}
5560

5661
return response, nil
5762
}

0 commit comments

Comments
 (0)