SendResp 发送响应对象
(resp *http.Response)
| 900 | |
| 901 | // SendResp 发送响应对象 |
| 902 | func (this *HTTPWriter) SendResp(resp *http.Response) (int64, error) { |
| 903 | this.isFinished = true |
| 904 | |
| 905 | for k, v := range resp.Header { |
| 906 | this.SetHeader(k, v) |
| 907 | } |
| 908 | |
| 909 | this.WriteHeader(resp.StatusCode) |
| 910 | var bufPool = this.req.bytePool(resp.ContentLength) |
| 911 | var buf = bufPool.Get() |
| 912 | defer bufPool.Put(buf) |
| 913 | |
| 914 | return io.CopyBuffer(this, resp.Body, buf.Bytes) |
| 915 | } |
| 916 | |
| 917 | // Redirect 跳转 |
| 918 | func (this *HTTPWriter) Redirect(status int, url string) { |
nothing calls this directly
no test coverage detected