mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-25 14:36:34 +08:00
修复WebP缓存长度可能不正确的问题
This commit is contained in:
@@ -193,6 +193,7 @@ func (this *HTTPRequest) doCacheRead() (shouldStop bool) {
|
||||
this.writer.WriteHeader(http.StatusNotModified)
|
||||
this.isCached = true
|
||||
this.cacheRef = nil
|
||||
this.writer.SetOk()
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -203,6 +204,7 @@ func (this *HTTPRequest) doCacheRead() (shouldStop bool) {
|
||||
this.writer.WriteHeader(http.StatusNotModified)
|
||||
this.isCached = true
|
||||
this.cacheRef = nil
|
||||
this.writer.SetOk()
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -349,7 +351,6 @@ func (this *HTTPRequest) doCacheRead() (shouldStop bool) {
|
||||
}
|
||||
} else { // 没有Range
|
||||
this.writer.PrepareCompression(reader.BodySize())
|
||||
|
||||
this.writer.WriteHeader(reader.Status())
|
||||
|
||||
err = reader.ReadBody(buf, func(n int) (goNext bool, err error) {
|
||||
@@ -370,5 +371,8 @@ func (this *HTTPRequest) doCacheRead() (shouldStop bool) {
|
||||
|
||||
this.isCached = true
|
||||
this.cacheRef = nil
|
||||
|
||||
this.writer.SetOk()
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user