Skip to content

Commit dac3659

Browse files
authored
fix: support multiple options in WithHTTPReqHandlerOption (#53)
1 parent ee39554 commit dac3659

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

client.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,14 @@ func WithServiceName(serviceName string) ClientOption {
254254
}
255255
}
256256

257-
// WithHTTPReqHandlerOption adds an option for HTTP request handler.
257+
// WithHTTPReqHandlerOption adds one or more options for HTTP request handler.
258258
// This is typically only needed when using custom implementations of HTTPReqHandler
259259
// that support additional configuration options.
260-
func WithHTTPReqHandlerOption(option HTTPReqHandlerOption) ClientOption {
260+
func WithHTTPReqHandlerOption(options ...HTTPReqHandlerOption) ClientOption {
261261
return func(c *Client) {
262-
c.transportOptions = append(c.transportOptions, withTransportHTTPReqHandlerOption(option))
262+
for _, option := range options {
263+
c.transportOptions = append(c.transportOptions, withTransportHTTPReqHandlerOption(option))
264+
}
263265
}
264266
}
265267

0 commit comments

Comments
 (0)