mirror of
https://github.com/cloudflare/redoctober.git
synced 2026-09-20 14:34:14 +00:00
check response status before parse the response bytes
This commit is contained in:
@@ -70,6 +70,11 @@ func (c *RemoteServer) doAction(action string, req []byte) ([]byte, error) {
|
||||
}
|
||||
resp.Body.Close()
|
||||
|
||||
// Return response body as error if status code != 200
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return nil, errors.New(string(body))
|
||||
}
|
||||
|
||||
return body, nil
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user