From 62479737a70685d09fb9b38e419ff4960c35903b Mon Sep 17 00:00:00 2001 From: Bogdan Date: Mon, 4 Nov 2024 14:23:29 +0200 Subject: [PATCH] Fixed: (Torrent RSS) Clear old cookies on edit Fixes #2275 --- .../Indexers/Definitions/TorrentRss/TorrentRssIndexer.cs | 9 +++++++++ src/NzbDrone.Core/Indexers/HttpIndexerBase.cs | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/TorrentRss/TorrentRssIndexer.cs b/src/NzbDrone.Core/Indexers/Definitions/TorrentRss/TorrentRssIndexer.cs index 52af639b0..c2afa00d2 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/TorrentRss/TorrentRssIndexer.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/TorrentRss/TorrentRssIndexer.cs @@ -1,4 +1,6 @@ using System.Collections.Generic; +using System.Threading.Tasks; +using FluentValidation.Results; using NLog; using NzbDrone.Core.Configuration; using NzbDrone.Core.Messaging.Events; @@ -44,6 +46,13 @@ namespace NzbDrone.Core.Indexers.Definitions.TorrentRss } } + protected override Task TestConnection() + { + UpdateCookies(null, null); + + return base.TestConnection(); + } + private IndexerDefinition GetDefinition(string name, string description, TorrentRssIndexerSettings settings) { return new IndexerDefinition diff --git a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs index 2303efeca..9b2ab82f2 100644 --- a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs @@ -650,7 +650,7 @@ namespace NzbDrone.Core.Indexers { foreach (var cookie in Cookies) { - request.HttpRequest.Cookies.Add(cookie.Key, cookie.Value); + request.HttpRequest.Cookies[cookie.Key] = cookie.Value; } }