From 5833549535c6d0f3f93bf85ac798cd5e4f6ab014 Mon Sep 17 00:00:00 2001 From: Qstick Date: Mon, 1 Mar 2021 20:51:21 -0500 Subject: [PATCH] Fixed: Indexer with Redirect not using Redirect --- src/Prowlarr.Api.V1/Indexers/IndexerModule.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Prowlarr.Api.V1/Indexers/IndexerModule.cs b/src/Prowlarr.Api.V1/Indexers/IndexerModule.cs index af4a9cac0..4d3c0e29d 100644 --- a/src/Prowlarr.Api.V1/Indexers/IndexerModule.cs +++ b/src/Prowlarr.Api.V1/Indexers/IndexerModule.cs @@ -99,7 +99,8 @@ namespace Prowlarr.Api.V1.Indexers private object GetDownload(int id) { - var indexer = _indexerFactory.Get(id); + var indexerDef = _indexerFactory.Get(id); + var indexer = _indexerFactory.GetInstance(indexerDef); var link = Request.Query.Link; var file = Request.Query.File; @@ -120,10 +121,10 @@ namespace Prowlarr.Api.V1.Indexers var unprotectedlLink = _downloadMappingService.ConvertToNormalLink((string)link.Value); // If Indexer is set to download via Redirect then just redirect to the link - if (indexer.SupportsRedirect && indexer.Redirect) + if (indexer.SupportsRedirect && indexerDef.Redirect) { _downloadService.RecordRedirect(unprotectedlLink, id, source, file); - return Response.AsRedirect(unprotectedlLink, RedirectResponse.RedirectType.Temporary); + return Response.AsRedirect(unprotectedlLink); } var downloadBytes = Array.Empty(); @@ -140,7 +141,7 @@ namespace Prowlarr.Api.V1.Indexers && downloadBytes[6] == 0x3a) { var magnetUrl = Encoding.UTF8.GetString(downloadBytes); - return Response.AsRedirect(magnetUrl, RedirectResponse.RedirectType.Temporary); + return Response.AsRedirect(magnetUrl); } var contentType = indexer.Protocol == DownloadProtocol.Torrent ? "application/x-bittorrent" : "application/x-nzb";