mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 16:21:11 +08:00
25w09a
This commit is contained in:
parent
6e787ced6e
commit
50fee8eb5a
7 changed files with 41 additions and 23 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue