Skip to content

Commit

Permalink
Merge pull request #289 from thrawn01/thrawn/develop
Browse files Browse the repository at this point in the history
Added special case for Host headers
  • Loading branch information
thrawn01 committed May 27, 2022
2 parents 6e8672e + 2ced99e commit 892f9f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions httphelpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions messages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 892f9f4

Please sign in to comment.