|
|
@ -47,6 +47,10 @@ namespace NzbDrone.Common.Http.Dispatchers
|
|
|
|
AddRequestHeaders(webRequest, request.Headers);
|
|
|
|
AddRequestHeaders(webRequest, request.Headers);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HttpWebResponse httpWebResponse;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
if (request.ContentData != null)
|
|
|
|
if (request.ContentData != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
webRequest.ContentLength = request.ContentData.Length;
|
|
|
|
webRequest.ContentLength = request.ContentData.Length;
|
|
|
@ -56,10 +60,6 @@ namespace NzbDrone.Common.Http.Dispatchers
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
HttpWebResponse httpWebResponse;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
httpWebResponse = (HttpWebResponse)webRequest.GetResponse();
|
|
|
|
httpWebResponse = (HttpWebResponse)webRequest.GetResponse();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (WebException e)
|
|
|
|
catch (WebException e)
|
|
|
@ -78,13 +78,17 @@ namespace NzbDrone.Common.Http.Dispatchers
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new WebException($"DNS Name Resolution Failure: '{webRequest.RequestUri.Host}'", e.Status);
|
|
|
|
throw new WebException($"DNS Name Resolution Failure: '{webRequest.RequestUri.Host}'", e.Status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (e.ToString().Contains("TLS Support not"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new TlsFailureException(webRequest, e);
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (e.ToString().Contains("The authentication or decryption has failed."))
|
|
|
|
else if (e.ToString().Contains("The authentication or decryption has failed."))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new TlsFailureException(webRequest, e);
|
|
|
|
throw new TlsFailureException(webRequest, e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (OsInfo.IsNotWindows)
|
|
|
|
else if (OsInfo.IsNotWindows)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new WebException($"{e.Message}: '{webRequest.RequestUri}'", e.Status);
|
|
|
|
throw new WebException($"{e.Message}: '{webRequest.RequestUri}'", e, e.Status, e.Response);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|