@@ -255,8 +255,15 @@ func TestOptionHeaders(t *testing.T) {
255
255
env map [string ]string
256
256
jsonRaw json.RawMessage
257
257
}{
258
- "JSON" : {jsonRaw : json .RawMessage (`{"headers":{"X-MY-HEADER1":"hval1","X-MY-HEADER2":"hval2"}}` )},
259
- "Env" : {env : map [string ]string {"K6_PROMETHEUS_RW_HEADERS_X-MY-HEADER1" : "hval1" , "K6_PROMETHEUS_RW_HEADERS_X-MY-HEADER2" : "hval2" }},
258
+ "JSON" : {jsonRaw : json .RawMessage (
259
+ `{"headers":{"X-MY-HEADER1":"hval1","X-MY-HEADER2":"hval2","X-Scope-OrgID":"my-org-id","another-header":"true","empty":""}}` )},
260
+ "Env" : {env : map [string ]string {
261
+ "K6_PROMETHEUS_RW_HEADERS_X-MY-HEADER1" : "hval1" ,
262
+ "K6_PROMETHEUS_RW_HEADERS_X-MY-HEADER2" : "hval2" ,
263
+ // it assert that the new method using HTTP_HEADERS overwrites it
264
+ "K6_PROMETHEUS_RW_HEADERS_X-Scope-OrgID" : "my-org-id-old-method" ,
265
+ "K6_PROMETHEUS_RW_HTTP_HEADERS" : "X-Scope-OrgID:my-org-id,another-header:true,empty:" ,
266
+ }},
260
267
//nolint:gocritic
261
268
//"Arg": {arg: "headers.X-MY-HEADER1=hval1,headers.X-MY-HEADER2=hval2"},
262
269
}
@@ -266,8 +273,11 @@ func TestOptionHeaders(t *testing.T) {
266
273
InsecureSkipTLSVerify : null .BoolFrom (false ),
267
274
PushInterval : types .NullDurationFrom (5 * time .Second ),
268
275
Headers : map [string ]string {
269
- "X-MY-HEADER1" : "hval1" ,
270
- "X-MY-HEADER2" : "hval2" ,
276
+ "X-MY-HEADER1" : "hval1" ,
277
+ "X-MY-HEADER2" : "hval2" ,
278
+ "X-Scope-OrgID" : "my-org-id" ,
279
+ "another-header" : "true" ,
280
+ "empty" : "" ,
271
281
},
272
282
TrendStats : []string {"p(99)" },
273
283
StaleMarkers : null .BoolFrom (false ),
0 commit comments