From 8c576249b3ef5a261c31d54583f21c8b1dc5e79b Mon Sep 17 00:00:00 2001 From: Felix Date: Mon, 2 Mar 2026 16:11:51 +0200 Subject: [PATCH] refactor: extract and validate HTTP timeout, ensuring a positive default value. --- JackTor/JackTorInvoke.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/JackTor/JackTorInvoke.cs b/JackTor/JackTorInvoke.cs index e3fdc5a..a7e4e78 100644 --- a/JackTor/JackTorInvoke.cs +++ b/JackTor/JackTorInvoke.cs @@ -95,9 +95,13 @@ namespace JackTor try { _onLog?.Invoke($"JackTor: запит до Jackett -> {query}"); + int timeoutSeconds = Convert.ToInt32(_init.httptimeout); + if (timeoutSeconds <= 0) + timeoutSeconds = 12; + var root = await Http.Get( _init.cors(url), - timeoutSeconds: _init.httptimeout > 0 ? _init.httptimeout : 12, + timeoutSeconds: timeoutSeconds, headers: headers, proxy: _proxyManager.Get() );