From e0dc641faefa350af644381b5dd8bc43a211b0db Mon Sep 17 00:00:00 2001 From: Secriy Date: Sat, 7 Dec 2024 20:20:43 +0800 Subject: [PATCH] fix: escape URL path to prevent issues with unescaped characters (#1334) --- config/webhook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/webhook.go b/config/webhook.go index e69f16276..1af51a204 100644 --- a/config/webhook.go +++ b/config/webhook.go @@ -74,7 +74,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.Path, u.Query().Encode()), strings.NewReader(postPara)) + req, err := http.NewRequest(method, fmt.Sprintf("%s://%s%s?%s", u.Scheme, u.Host, u.EscapedPath(), u.Query().Encode()), strings.NewReader(postPara)) if err != nil { util.Log("Webhook调用失败! 异常信息:%s", err) return