Browse Source

Final push on browser proxy code

Toby Chui 3 years ago
parent
commit
c8b3dc0298
1 changed files with 4 additions and 1 deletions
  1. 4 1
      mod/agi/agi.http.go

+ 4 - 1
mod/agi/agi.http.go

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