Update test for redirect diagnostic.

This commit is contained in:
Taloth Saldono 2015-03-15 02:00:44 +01:00
parent a3873634b0
commit 593c4b8182
2 changed files with 4 additions and 2 deletions

View File

@ -70,7 +70,9 @@ namespace NzbDrone.Common.Test.Http
{
var request = new HttpRequest("http://eu.httpbin.org/status/" + (int)statusCode);
Assert.Throws<Exception>(() => Subject.Get<HttpBinResource>(request));
Subject.Get<HttpBinResource>(request);
ExceptionVerification.ExpectedErrors(1);
}
[Test]

View File

@ -110,7 +110,7 @@ namespace NzbDrone.Common.Http
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))