This commit is contained in:
UlricQin 2021-01-19 18:41:51 +08:00
parent a4c8638448
commit e8ba0fb0bb
1 changed files with 12 additions and 2 deletions

View File

@ -292,7 +292,12 @@ func taskHostStdout(c *gin.Context) {
}
url := fmt.Sprintf("http://%s:%d/output/%d/stdout.json", host, config.Config.Output.RemotePort, id)
resp, err := http.Get(url)
client := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
},
}
resp, err := client.Get(url)
dangerous(err)
defer resp.Body.Close()
@ -320,7 +325,12 @@ func taskHostStderr(c *gin.Context) {
}
url := fmt.Sprintf("http://%s:%d/output/%d/stderr.json", host, config.Config.Output.RemotePort, id)
resp, err := http.Get(url)
client := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
},
}
resp, err := client.Get(url)
dangerous(err)
defer resp.Body.Close()