Skip to content

Commit

Permalink
add testcase for host header
Browse files Browse the repository at this point in the history
  • Loading branch information
srijan-27 committed Jun 21, 2024
1 parent b4b031d commit 4606683
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion exporters/zipkin/zipkin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func TestExportSpans(t *testing.T) {
srv := httptest.NewServer(http.HandlerFunc(handler))
defer srv.Close()

headers := map[string]string{"name1": "value1", "name2": "value2"}
headers := map[string]string{"name1": "value1", "name2": "value2", "host": "example"}
e := &Exporter{
url: srv.URL,
client: srv.Client(),
Expand All @@ -345,6 +345,7 @@ func TestExportSpans(t *testing.T) {
_ = e.ExportSpans(context.Background(), spans)
req := <-got

assert.Equal(t, headers["host"], req.Host)
assert.Equal(t, headers["name1"], req.Header.Get("name1"))
assert.Equal(t, headers["name2"], req.Header.Get("name2"))
}
Expand Down

0 comments on commit 4606683

Please sign in to comment.