WebP无法解析原图时直接返回原图数据

This commit is contained in:
GoEdgeLab
2021-10-13 11:11:57 +08:00
parent 7e40bdd83f
commit decafbebb4
2 changed files with 27 additions and 10 deletions

View File

@@ -249,10 +249,12 @@ func (this *HTTPRequest) doReverseProxy() {
shouldAutoFlush := this.reverseProxy.AutoFlush || this.RawReq.Header.Get("Accept") == "text/event-stream"
// 准备
this.writer.Prepare(resp.ContentLength, resp.StatusCode)
delayHeaders := this.writer.Prepare(resp.ContentLength, resp.StatusCode)
// 设置响应代码
this.writer.WriteHeader(resp.StatusCode)
if !delayHeaders {
this.writer.WriteHeader(resp.StatusCode)
}
// 输出到客户端
pool := this.bytePool(resp.ContentLength)