Skip to content

Commit

Permalink
Provide an empty body if not provided to avoid having a nil body
Browse files Browse the repository at this point in the history
  • Loading branch information
celrenheit committed Jun 21, 2017
1 parent 6d71ed1 commit e34d504
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion htest.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package htest

import (
"bytes"
"io"
"net/http"
"testing"
Expand Down Expand Up @@ -75,7 +76,7 @@ func (h *htest) Patch(path string) Requester {
}

func (h *htest) Request(method, path string) Requester {
return h.RequestWithBody(method, path, nil)
return h.RequestWithBody(method, path, bytes.NewReader([]byte{}))
}

func (h *htest) RequestWithBody(method, path string, body io.Reader) Requester {
Expand Down

0 comments on commit e34d504

Please sign in to comment.