fix: NoDirect HttpClient 浅拷贝逻辑问题

This commit is contained in:
Mmx233
2023-09-17 23:23:38 +08:00
parent 672db9c154
commit 0065d38893

View File

@@ -28,7 +28,8 @@ func (a *Api) Init(https bool, domain string, client *http.Client) {
// 初始化 http client
a.Client = client
a.NoDirect = &(*client)
copyClient := *client
a.NoDirect = &copyClient
a.NoDirect.CheckRedirect = func(_ *http.Request, _ []*http.Request) error {
return http.ErrUseLastResponse
}