Change redirect type to 301 (Perm)

pull/25/head
Qstick 4 years ago
parent 9944484658
commit 1c1144f8c5

@ -123,7 +123,7 @@ namespace Prowlarr.Api.V1.Indexers
if (indexer.SupportsRedirect && indexerDef.Redirect)
{
_downloadService.RecordRedirect(unprotectedlLink, id, source, file);
return Response.AsRedirect(unprotectedlLink);
return Response.AsRedirect(unprotectedlLink, Nancy.Responses.RedirectResponse.RedirectType.Permanent);
}
var downloadBytes = Array.Empty<byte>();
@ -140,7 +140,7 @@ namespace Prowlarr.Api.V1.Indexers
&& downloadBytes[6] == 0x3a)
{
var magnetUrl = Encoding.UTF8.GetString(downloadBytes);
return Response.AsRedirect(magnetUrl);
return Response.AsRedirect(magnetUrl, Nancy.Responses.RedirectResponse.RedirectType.Permanent);
}
var contentType = indexer.Protocol == DownloadProtocol.Torrent ? "application/x-bittorrent" : "application/x-nzb";

@ -1,4 +1,4 @@
using Nancy;
using Nancy;
using Nancy.ErrorHandling;
using Prowlarr.Http.Extensions;
@ -13,7 +13,7 @@ namespace Prowlarr.Http.ErrorManagement
public void Handle(HttpStatusCode statusCode, NancyContext context)
{
if (statusCode == HttpStatusCode.SeeOther || statusCode == HttpStatusCode.OK)
if (statusCode == HttpStatusCode.SeeOther || statusCode == HttpStatusCode.MovedPermanently || statusCode == HttpStatusCode.OK)
{
return;
}

Loading…
Cancel
Save