diff --git a/src/NzbDrone.Common.Test/Http/HttpClientFixture.cs b/src/NzbDrone.Common.Test/Http/HttpClientFixture.cs index 8673dae16..0b7d0fb9b 100644 --- a/src/NzbDrone.Common.Test/Http/HttpClientFixture.cs +++ b/src/NzbDrone.Common.Test/Http/HttpClientFixture.cs @@ -70,7 +70,9 @@ public void should_not_follow_redirects_when_not_in_production(HttpStatusCode st { var request = new HttpRequest("http://eu.httpbin.org/status/" + (int)statusCode); - Assert.Throws(() => Subject.Get(request)); + Subject.Get(request); + + ExceptionVerification.ExpectedErrors(1); } [Test] diff --git a/src/NzbDrone.Common/Http/HttpClient.cs b/src/NzbDrone.Common/Http/HttpClient.cs index 8b5c42edd..d5585250b 100644 --- a/src/NzbDrone.Common/Http/HttpClient.cs +++ b/src/NzbDrone.Common/Http/HttpClient.cs @@ -110,7 +110,7 @@ public HttpResponse Execute(HttpRequest request) var response = new HttpResponse(request, new HttpHeader(httpWebResponse.Headers), data, httpWebResponse.StatusCode); _logger.Trace("{0} ({1:n0} ms)", response, stopWatch.ElapsedMilliseconds); - if (!RuntimeInfoBase.IsProduction && + if (request.AllowAutoRedirect && !RuntimeInfoBase.IsProduction && (response.StatusCode == HttpStatusCode.Moved || response.StatusCode == HttpStatusCode.MovedPermanently || response.StatusCode == HttpStatusCode.Found))