This commit is contained in:
WJQSERVER 2025-01-27 13:14:36 +08:00
parent 6e787ced6e
commit 50fee8eb5a
7 changed files with 41 additions and 23 deletions

View file

@ -86,13 +86,8 @@ func GitReq(c *gin.Context, u string, cfg *config.Config, mode string, runMode s
CopyResponseHeaders(resp, c, cfg)
c.Status(resp.StatusCode)
if err := gitCopyResponseBody(c, resp.Body); err != nil {
if _, err := io.Copy(c.Writer, resp.Body); err != nil {
logError("%s %s %s %s %s Response-Copy-Error: %v", c.ClientIP(), method, u, c.Request.Header.Get("User-Agent"), c.Request.Proto, err)
}
}
// 复制响应体
func gitCopyResponseBody(c *gin.Context, respBody io.Reader) error {
_, err := io.Copy(c.Writer, respBody)
return err
}