fix(request): deep copy shared header object in request options

This commit is contained in:
HFO4
2022-10-15 16:16:17 +08:00
parent c7dc143d30
commit 8494bd6eb9
4 changed files with 8 additions and 2 deletions

View File

@@ -44,6 +44,12 @@ func newDefaultOption() *options {
}
}
func (o *options) clone() options {
newOptions := *o
newOptions.header = o.header.Clone()
return newOptions
}
// WithTimeout 设置请求超时
func WithTimeout(t time.Duration) Option {
return optionFunc(func(o *options) {