mirror of
https://github.com/jeessy2/ddns-go.git
synced 2025-10-20 15:33:46 +08:00
fix: use u.String() to build request URL instead of manual concatenation (#1560)
This commit is contained in:
@ -2,7 +2,6 @@ package config
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
@ -74,7 +73,7 @@ func ExecWebhook(domains *Domains, conf *Config) (v4Status updateStatusType, v6S
|
||||
util.Log("Webhook配置中的URL不正确")
|
||||
return
|
||||
}
|
||||
req, err := http.NewRequest(method, fmt.Sprintf("%s://%s%s?%s", u.Scheme, u.Host, u.EscapedPath(), u.Query().Encode()), strings.NewReader(postPara))
|
||||
req, err := http.NewRequest(method, u.String(), strings.NewReader(postPara))
|
||||
if err != nil {
|
||||
util.Log("Webhook调用失败! 异常信息:%s", err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user