mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-25 08:20:25 +08:00
如果源站返回的内容长度为0,则不再尝试读取数据
This commit is contained in:
@@ -293,6 +293,13 @@ func (this *HTTPRequest) doReverseProxy() {
|
||||
this.writer.WriteHeader(resp.StatusCode)
|
||||
}
|
||||
|
||||
// 是否有内容
|
||||
if resp.ContentLength == 0 && len(resp.TransferEncoding) == 0 {
|
||||
_ = resp.Body.Close()
|
||||
this.writer.SetOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 输出到客户端
|
||||
pool := this.bytePool(resp.ContentLength)
|
||||
buf := pool.Get()
|
||||
|
||||
Reference in New Issue
Block a user