删除HTTP/2自动关闭Body的逻辑

This commit is contained in:
刘祥超
2022-08-24 16:43:32 +08:00
parent 0b306f0a22
commit 8afd00f00d

View File

@@ -252,12 +252,6 @@ func (this *HTTPRequest) doOriginRequest(failedOriginIds []int64, failedLnNodeId
return return
} }
// 在HTTP/2下需要防止因为requestBody而导致Content-Length为空的问题
if this.RawReq.ProtoMajor == 2 && this.RawReq.ContentLength == 0 && this.RawReq.Body != nil {
_ = this.RawReq.Body.Close()
this.RawReq.Body = nil
}
// 开始请求 // 开始请求
resp, err := client.Do(this.RawReq) resp, err := client.Do(this.RawReq)
if err != nil { if err != nil {