fix: use u.String() to build request URL instead of manual concatenation (#1560)

This commit is contained in:
NieZheti
2025-10-01 20:04:14 +08:00
committed by GitHub
parent b5248e2d95
commit 99e49aae1a

View File

@ -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