修复缓存状态码不生效的问题

This commit is contained in:
刘祥超
2021-05-23 14:29:56 +08:00
parent 63e3b7ac2f
commit b2f18c22ee
5 changed files with 13 additions and 5 deletions

View File

@@ -226,7 +226,7 @@ func (this *HTTPRequest) doReverseProxy() {
shouldAutoFlush := this.reverseProxy.AutoFlush || this.RawReq.Header.Get("Accept") == "text/event-stream"
// 准备
this.writer.Prepare(resp.ContentLength)
this.writer.Prepare(resp.ContentLength, resp.StatusCode)
// 设置响应代码
this.writer.WriteHeader(resp.StatusCode)