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:
parent
295b89b702
commit
ea2bda523f
@ -239,6 +239,7 @@ func (c *HTTPClient) onBotPushEvent(e *coolq.Event) {
|
|||||||
req, _ := http.NewRequest("POST", c.addr, bytes.NewReader(e.JSONBytes()))
|
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("X-Self-ID", strconv.FormatInt(c.bot.Client.Uin, 10))
|
||||||
req.Header.Set("User-Agent", "CQHttp/4.15.0")
|
req.Header.Set("User-Agent", "CQHttp/4.15.0")
|
||||||
|
req.Header.Set("Content-Type", "application/json")
|
||||||
if c.secret != "" {
|
if c.secret != "" {
|
||||||
mac := hmac.New(sha1.New, []byte(c.secret))
|
mac := hmac.New(sha1.New, []byte(c.secret))
|
||||||
_, _ = mac.Write(e.JSONBytes())
|
_, _ = mac.Write(e.JSONBytes())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user