diff --git a/httphelpers.go b/httphelpers.go index 3ff0d112..88121a5c 100644 --- a/httphelpers.go +++ b/httphelpers.go @@ -359,6 +359,11 @@ func (r *httpRequest) curlString(req *http.Request, p payload) string { } } + // Special case for Host + if req.Host != "" { + parts = append(parts, fmt.Sprintf("-H \"Host: %s\"", req.Host)) + } + //parts = append(parts, fmt.Sprintf(" --user '%s:%s'", r.BasicAuthUser, r.BasicAuthPassword)) if p != nil { diff --git a/messages_test.go b/messages_test.go index 112f62f4..131686a0 100644 --- a/messages_test.go +++ b/messages_test.go @@ -582,6 +582,8 @@ func TestAddOverrideHeader(t *testing.T) { ensure.Nil(t, err) ensure.DeepEqual(t, msg, exampleMessage) ensure.DeepEqual(t, id, exampleID) + + ensure.StringContains(t, mg.GetCurlOutput(), "Host:") } func TestCaptureCurlOutput(t *testing.T) {