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

将反向HTTP POST服务中请求的Method由GET修改为POST (#1794)

This commit is contained in:
仑质 2022-12-13 22:17:32 +08:00 committed by GitHub
parent 0e08ceccdd
commit 8343db5ae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -356,7 +356,7 @@ func (c *HTTPClient) onBotPushEvent(e *coolq.Event) {
for i := uint64(0); i <= c.MaxRetries; i++ { for i := uint64(0); i <= c.MaxRetries; i++ {
// see https://stackoverflow.com/questions/31337891/net-http-http-contentlength-222-with-body-length-0 // see https://stackoverflow.com/questions/31337891/net-http-http-contentlength-222-with-body-length-0
// we should create a new request for every single post trial // we should create a new request for every single post trial
req, err = http.NewRequest(http.MethodGet, c.addr, bytes.NewReader(e.JSONBytes())) req, err = http.NewRequest(http.MethodPost, c.addr, bytes.NewReader(e.JSONBytes()))
if err != nil { if err != nil {
log.Warnf("上报 Event 数据到 %v 时创建请求失败: %v", c.addr, err) log.Warnf("上报 Event 数据到 %v 时创建请求失败: %v", c.addr, err)
return return