Fixed: Follow 301 redirects when fetching torrents (#1653)

Closes #1564
pull/1637/merge
Mitchell Cash 7 years ago committed by Leonardo Galli
parent 7af88037bb
commit 28b523b504

@ -221,7 +221,9 @@ namespace NzbDrone.Core.Download
var response = _httpClient.Get(request);
if (response.StatusCode == HttpStatusCode.SeeOther || response.StatusCode == HttpStatusCode.Found)
if (response.StatusCode == HttpStatusCode.MovedPermanently ||
response.StatusCode == HttpStatusCode.Found ||
response.StatusCode == HttpStatusCode.SeeOther)
{
var locationHeader = response.Headers.GetSingleValue("Location");
@ -321,7 +323,9 @@ namespace NzbDrone.Core.Download
var response = _httpClient.Get(request);
if (response.StatusCode == HttpStatusCode.SeeOther || response.StatusCode == HttpStatusCode.Found)
if (response.StatusCode == HttpStatusCode.MovedPermanently ||
response.StatusCode == HttpStatusCode.Found ||
response.StatusCode == HttpStatusCode.SeeOther)
{
var locationHeader = response.Headers.GetSingleValue("Location");

Loading…
Cancel
Save