|
@@ -155,7 +155,10 @@ func (g *Gateway) injectHTTPFunctions(vm *otto.Otto, u *user.User) {
|
|
|
return errors.New("Redirect")
|
|
|
}
|
|
|
|
|
|
- response, _ := client.Do(req)
|
|
|
+ response, err := client.Do(req)
|
|
|
+ if err != nil {
|
|
|
+ return otto.FalseValue()
|
|
|
+ }
|
|
|
vm.Run(`var _location = "` + payload + `";`)
|
|
|
value, _ := otto.ToValue(response.StatusCode)
|
|
|
return value
|