When calling consumer function, we use many default headers like KEDA-Topic, KEDA-Response-Topic, KEDA-Error-Topic, Content-Type, KEDA-Source-Name.
We merge theses headers to kafka message and forward the request to consumer function. If kafka message contains header Content-Type then value of this header will be merged with our default value and resultant header will be like this.
Content-Type:[application/json application/json]
To avoid this, we use headers.Set method instead of headers.Add which replaces any existing value associated with the key.
KEDA-Topic
,KEDA-Response-Topic
,KEDA-Error-Topic
,Content-Type
,KEDA-Source-Name
.Content-Type
then value of this header will be merged with our default value and resultant header will be like this.headers.Set
method instead ofheaders.Add
which replaces any existing value associated with the key.Fixes #45