mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-26 02:04:50 -06:00
7e77ac5088
There is a new optional `timeout` option to specify with `http.send` which will set a client timeout on the request. This will override the default 5 second timeout. This change also corrects the request to use the builtin context. This means that if the evaluation is canceled the request will also now be canceled. There is an environment variable for adjusting the default timeout which we should aim to remove in future OPA versions (when appropriate). For now though it is still supported, and will panic if supplied with an invalid value rather than previously ignoring it and effectively disable the timeout (0 == unlimited). Fixes: #2099 Signed-off-by: Patrick East <east.patrick@gmail.com>