重构对HTTP请求的处理方法:缓存、压缩、WebP、限速

This commit is contained in:
GoEdgeLab
2022-02-15 14:55:49 +08:00
parent 3774cda2ff
commit 158cb258f6
19 changed files with 903 additions and 616 deletions

View File

@@ -54,9 +54,9 @@ func (this *HTTPRequest) doURL(method string, url string, host string, statusCod
}
this.writer.AddHeaders(resp.Header)
if statusCode <= 0 {
this.writer.Prepare(resp.ContentLength, resp.StatusCode)
this.writer.Prepare(resp, resp.ContentLength, resp.StatusCode, true)
} else {
this.writer.Prepare(resp.ContentLength, statusCode)
this.writer.Prepare(resp, resp.ContentLength, statusCode, true)
}
// 设置响应代码