Skip to content

Commit

Permalink
fix: use util.CreateHTTPClient to create http client (jeessy2#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
yin1999 authored Oct 9, 2022
1 parent bcff155 commit 2f997b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions dns/callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dns

import (
"encoding/json"
"fmt"
"log"
"net/http"
"net/url"
Expand Down Expand Up @@ -89,10 +88,10 @@ func (cb *Callback) addUpdateDomainRecords(recordType string) {
resp, err := clt.Do(req)
body, err := util.GetHTTPResponseOrg(resp, requestURL, err)
if err == nil {
log.Println(fmt.Sprintf("Callback调用成功, 返回数据: %s", string(body)))
log.Printf("Callback调用成功, 返回数据: %s\n", string(body))
domain.UpdateStatus = config.UpdatedSuccess
} else {
log.Println(fmt.Sprintf("Callback调用失败,Err:%s", err))
log.Printf("Callback调用失败,Err:%s\n", err)
domain.UpdateStatus = config.UpdatedFailed
}
}
Expand Down
4 changes: 2 additions & 2 deletions dns/dnspod.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dns

import (
"log"
"net/http"
"net/url"

"github.com/jeessy2/ddns-go/v4/config"
Expand Down Expand Up @@ -157,7 +156,8 @@ func (dnspod *Dnspod) modify(record DnspodRecord, domain *config.Domain, recordT

// 公共
func (dnspod *Dnspod) commonRequest(apiAddr string, values url.Values, domain *config.Domain) (status DnspodStatus, err error) {
resp, err := http.PostForm(
client := util.CreateHTTPClient()
resp, err := client.PostForm(
apiAddr,
values,
)
Expand Down

0 comments on commit 2f997b4

Please sign in to comment.