mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-09 11:20:25 +08:00
修复内容为空时无法缓存的Bug
This commit is contained in:
@@ -328,7 +328,12 @@ func (this *HTTPRequest) doReverseProxy() {
|
||||
|
||||
// 是否有内容
|
||||
if resp.ContentLength == 0 && len(resp.TransferEncoding) == 0 {
|
||||
// 即使内容为0,也需要读取一次,以便于触发相关事件
|
||||
var buf = utils.BytePool4k.Get()
|
||||
_, _ = io.CopyBuffer(this.writer, resp.Body, buf)
|
||||
utils.BytePool4k.Put(buf)
|
||||
_ = resp.Body.Close()
|
||||
|
||||
this.writer.SetOk()
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user