Fixed: http->https redirects do not use the tls1.2 curl fallback.

fixes #2082
This commit is contained in:
Taloth Saldono 2017-08-01 19:31:10 +02:00 committed by Qstick
parent 12d89b9ab5
commit 96d97f873a
4 changed files with 85 additions and 28 deletions

View file

@ -61,7 +61,7 @@ namespace NzbDrone.Common.Test.Http
response.Content.Should().NotBeNullOrWhiteSpace();
}
[Test]
public void should_execute_https_get()
{
@ -144,6 +144,33 @@ namespace NzbDrone.Common.Test.Http
ExceptionVerification.ExpectedErrors(0);
}
[Test]
public void should_follow_redirects_to_https()
{
var request = new HttpRequestBuilder($"http://{_httpBinHost}/redirect-to")
.AddQueryParam("url", $"https://sonarr.tv/")
.Build();
request.AllowAutoRedirect = true;
var response = Subject.Get(request);
response.StatusCode.Should().Be(HttpStatusCode.OK);
response.Content.Should().Contain("Sonarr");
ExceptionVerification.ExpectedErrors(0);
}
[Test]
public void should_throw_on_too_many_redirects()
{
var request = new HttpRequest($"http://{_httpBinHost}/redirect/4");
request.AllowAutoRedirect = true;
Assert.Throws<WebException>(() => Subject.Get(request));
ExceptionVerification.ExpectedErrors(0);
}
[Test]
public void should_send_user_agent()
{
@ -407,4 +434,4 @@ namespace NzbDrone.Common.Test.Http
public string Url { get; set; }
public string Data { get; set; }
}
}
}