fix ssrf
This commit is contained in:
parent
a4c8638448
commit
e8ba0fb0bb
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue