From 51a26e582ad8d992da8025f2807a1d918983cc1e Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Wed, 14 May 2025 16:06:41 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81):=20?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E4=BD=BF=E7=94=A8=E5=A4=96=E9=83=A8http?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aipdw.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aipdw.go b/aipdw.go index 041392d..a20b424 100644 --- a/aipdw.go +++ b/aipdw.go @@ -12,8 +12,8 @@ import ( ) var ( - client = &http.Client{Timeout: 5 * time.Second} - ipCache = &sync.Map{} + ipCache = &sync.Map{} + DefaultHttpClient = &http.Client{Timeout: 5 * time.Second} ) type Body struct { @@ -61,7 +61,7 @@ func QueryIP(sk string, key string, ip string) (result Result, err error) { if err != nil { return } - resp, err := client.Do(req) + resp, err := DefaultHttpClient.Do(req) if err != nil { return }