1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-01-10 23:29:53 +02:00

Fixed: Use indexer errors from response if Content-Type is XML before processing response

This commit is contained in:
Bogdan 2023-05-18 16:02:14 +03:00 committed by Mark McDowall
parent 4fecd6ed89
commit 9bdc618366
2 changed files with 4 additions and 2 deletions

View File

@ -50,7 +50,8 @@ public static void CheckError(XDocument xdoc, IndexerResponse indexerResponse)
protected override bool PreProcess(IndexerResponse indexerResponse) protected override bool PreProcess(IndexerResponse indexerResponse)
{ {
if (indexerResponse.HttpResponse.HasHttpError) if (indexerResponse.HttpResponse.HasHttpError &&
(indexerResponse.HttpResponse.Headers.ContentType == null || !indexerResponse.HttpResponse.Headers.ContentType.Contains("xml")))
{ {
base.PreProcess(indexerResponse); base.PreProcess(indexerResponse);
} }

View File

@ -19,7 +19,8 @@ public TorznabRssParser()
protected override bool PreProcess(IndexerResponse indexerResponse) protected override bool PreProcess(IndexerResponse indexerResponse)
{ {
if (indexerResponse.HttpResponse.HasHttpError) if (indexerResponse.HttpResponse.HasHttpError &&
(indexerResponse.HttpResponse.Headers.ContentType == null || !indexerResponse.HttpResponse.Headers.ContentType.Contains("xml")))
{ {
base.PreProcess(indexerResponse); base.PreProcess(indexerResponse);
} }