mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-06 08:34:28 +01:00
Fixed: qBittorrent /login API success check
This commit is contained in:
parent
eb57d20545
commit
b3d46465ae
1 changed files with 4 additions and 4 deletions
|
|
@ -424,8 +424,8 @@ private void AuthenticateClient(HttpRequestBuilder requestBuilder, QBittorrentSe
|
||||||
}
|
}
|
||||||
catch (HttpException ex)
|
catch (HttpException ex)
|
||||||
{
|
{
|
||||||
_logger.Debug("qbitTorrent authentication failed.");
|
_logger.Debug(ex, "qbitTorrent authentication failed.");
|
||||||
if (ex.Response.StatusCode == HttpStatusCode.Forbidden)
|
if (ex.Response.StatusCode is HttpStatusCode.Unauthorized or HttpStatusCode.Forbidden)
|
||||||
{
|
{
|
||||||
throw new DownloadClientAuthenticationException("Failed to authenticate with qBittorrent.", ex);
|
throw new DownloadClientAuthenticationException("Failed to authenticate with qBittorrent.", ex);
|
||||||
}
|
}
|
||||||
|
|
@ -437,9 +437,9 @@ private void AuthenticateClient(HttpRequestBuilder requestBuilder, QBittorrentSe
|
||||||
throw new DownloadClientUnavailableException("Failed to connect to qBittorrent, please check your settings.", ex);
|
throw new DownloadClientUnavailableException("Failed to connect to qBittorrent, please check your settings.", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.Content != "Ok.")
|
// returns "Fails." on bad login
|
||||||
|
if (response.Content.IsNotNullOrWhiteSpace() && response.Content != "Ok.")
|
||||||
{
|
{
|
||||||
// returns "Fails." on bad login
|
|
||||||
_logger.Debug("qbitTorrent authentication failed.");
|
_logger.Debug("qbitTorrent authentication failed.");
|
||||||
throw new DownloadClientAuthenticationException("Failed to authenticate with qBittorrent.");
|
throw new DownloadClientAuthenticationException("Failed to authenticate with qBittorrent.");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue