UPSTREAM: 50639:  Extend SetHeader Requests method ito accept multiple values
This allows to set headers that are multivalued directly.
The headers variable is not directly accessible and currently
SetHeaders allows to set only one value.
@@ -502,11 +502,14 @@ func (r *Request) setParam(paramName, value string) *Request {
return r
}
-func (r *Request) SetHeader(key, value string) *Request {
+func (r *Request) SetHeader(key string, values ...string) *Request {
if r.headers == nil {
r.headers = http.Header{}
}
- r.headers.Set(key, value)
+ r.headers.Del(key)
+ for _, value := range values {
+ r.headers.Add(key, value)
+ }
return r
}
