From 9eb291f5785dc190c30ea7f9a8df7f699e51389d Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 31 Jan 2024 15:26:26 +0200 Subject: [PATCH] Fixed: Avoid trailing slash in Proxy Url sent to FlareSolverr --- .../FlareSolverr/FlareSolverr.cs | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/NzbDrone.Core/IndexerProxies/FlareSolverr/FlareSolverr.cs b/src/NzbDrone.Core/IndexerProxies/FlareSolverr/FlareSolverr.cs index c3edb880e..b309ec06e 100644 --- a/src/NzbDrone.Core/IndexerProxies/FlareSolverr/FlareSolverr.cs +++ b/src/NzbDrone.Core/IndexerProxies/FlareSolverr/FlareSolverr.cs @@ -115,7 +115,7 @@ namespace NzbDrone.Core.IndexerProxies.FlareSolverr MaxTimeout = maxTimeout, Proxy = new FlareSolverrProxy { - Url = proxyUrl?.AbsoluteUri + Url = proxyUrl?.OriginalString } }; } @@ -141,7 +141,7 @@ namespace NzbDrone.Core.IndexerProxies.FlareSolverr MaxTimeout = maxTimeout, Proxy = new FlareSolverrProxy { - Url = proxyUrl?.AbsoluteUri + Url = proxyUrl?.OriginalString } }; } @@ -206,17 +206,13 @@ namespace NzbDrone.Core.IndexerProxies.FlareSolverr private Uri GetProxyUri(HttpProxySettings proxySettings) { - switch (proxySettings.Type) + return proxySettings.Type switch { - case ProxyType.Http: - return new Uri("http://" + proxySettings.Host + ":" + proxySettings.Port); - case ProxyType.Socks4: - return new Uri("socks4://" + proxySettings.Host + ":" + proxySettings.Port); - case ProxyType.Socks5: - return new Uri("socks5://" + proxySettings.Host + ":" + proxySettings.Port); - default: - return null; - } + ProxyType.Http => new Uri("http://" + proxySettings.Host + ":" + proxySettings.Port), + ProxyType.Socks4 => new Uri("socks4://" + proxySettings.Host + ":" + proxySettings.Port), + ProxyType.Socks5 => new Uri("socks5://" + proxySettings.Host + ":" + proxySettings.Port), + _ => null + }; } private class FlareSolverrRequest