1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-06-19 05:55:04 +08:00

修正 HTTP POST 内容类型为 json (#1168)

This commit is contained in:
wasupandceacar 2021-11-16 21:36:23 -05:00 committed by GitHub
parent 295b89b702
commit ea2bda523f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -239,6 +239,7 @@ func (c *HTTPClient) onBotPushEvent(e *coolq.Event) {
req, _ := http.NewRequest("POST", c.addr, bytes.NewReader(e.JSONBytes()))
req.Header.Set("X-Self-ID", strconv.FormatInt(c.bot.Client.Uin, 10))
req.Header.Set("User-Agent", "CQHttp/4.15.0")
req.Header.Set("Content-Type", "application/json")
if c.secret != "" {
mac := hmac.New(sha1.New, []byte(c.secret))
_, _ = mac.Write(e.JSONBytes())