From: Kirill Zhdanov Date: Tue, 25 Jan 2022 15:13:44 +0000 (+0100) Subject: Negative maxTimeoutSeconds X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fb6d817ceb28935edb33541d6909ffd8811b7713;p=blackbox_exporter.git Negative maxTimeoutSeconds Fixes #868 Signed-off-by: Kirill Zhdanov --- diff --git a/main.go b/main.go index 0c5a14f..1c2e77b 100644 --- a/main.go +++ b/main.go @@ -442,7 +442,7 @@ func getTimeout(r *http.Request, module config.Module, offset float64) (timeoutS } var maxTimeoutSeconds = timeoutSeconds - offset - if module.Timeout.Seconds() < maxTimeoutSeconds && module.Timeout.Seconds() > 0 { + if module.Timeout.Seconds() < maxTimeoutSeconds && module.Timeout.Seconds() > 0 || maxTimeoutSeconds < 0 { timeoutSeconds = module.Timeout.Seconds() } else { timeoutSeconds = maxTimeoutSeconds