@@ -25,6 +25,8 @@ import (
2525 "testing"
2626
2727 "github.com/stretchr/testify/require"
28+
29+ "github.com/elastic/beats/v7/libbeat/common/productorigin"
2830)
2931
3032func TestAPIKeyEncoding (t * testing.T ) {
@@ -71,18 +73,21 @@ func TestHeaders(t *testing.T) {
7173 expected map [string ][]string
7274 }{
7375 {input : map [string ]string {
74- "Accept" : "application/vnd.elasticsearch+json;compatible-with=7" ,
75- "Content-Type" : "application/vnd.elasticsearch+json;compatible-with=7" ,
76- "X-My-Header" : "true" },
76+ "Accept" : "application/vnd.elasticsearch+json;compatible-with=7" ,
77+ "Content-Type" : "application/vnd.elasticsearch+json;compatible-with=7" ,
78+ productorigin .Header : "elastic-product" ,
79+ "X-My-Header" : "true" },
7780 expected : map [string ][]string {
78- "Accept" : {"application/vnd.elasticsearch+json;compatible-with=7" },
79- "Content-Type" : {"application/vnd.elasticsearch+json;compatible-with=7" },
80- "X-My-Header" : {"true" }}},
81+ "Accept" : {"application/vnd.elasticsearch+json;compatible-with=7" },
82+ "Content-Type" : {"application/vnd.elasticsearch+json;compatible-with=7" },
83+ productorigin .Header : {"elastic-product" },
84+ "X-My-Header" : {"true" }}},
8185 {input : map [string ]string {
8286 "X-My-Header" : "true" },
8387 expected : map [string ][]string {
84- "Accept" : {"application/json" },
85- "X-My-Header" : {"true" }}},
88+ "Accept" : {"application/json" },
89+ productorigin .Header : {productorigin .Beats },
90+ "X-My-Header" : {"true" }}},
8691 } {
8792 conn , err := NewConnection (ConnectionSettings {
8893 Headers : td .input ,
0 commit comments