1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Fixed: Not uploading nzbs to Nzbget on linux since previous develop.

This commit is contained in:
Taloth Saldono 2016-03-17 07:53:23 +01:00
parent 22aa759abc
commit eb70a6419c
2 changed files with 8 additions and 1 deletions

View File

@ -43,7 +43,9 @@ public HttpResponse GetResponse(HttpRequest request, CookieContainer cookies)
if (request.NetworkCredential != null)
{
throw new NotImplementedException("Credentials not supported for curl dispatcher.");
var authInfo = request.NetworkCredential.UserName + ":" + request.NetworkCredential.Password;
authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
request.Headers["Authorization"] = "Basic " + authInfo;
}
lock (CurlGlobalHandle.Instance)

View File

@ -23,6 +23,11 @@ public HttpResponse GetResponse(HttpRequest request, CookieContainer cookies)
webRequest.ContentLength = 0;
webRequest.CookieContainer = cookies;
if (request.NetworkCredential != null)
{
webRequest.PreAuthenticate = true;
}
if (request.RequestTimeout != TimeSpan.Zero)
{
webRequest.Timeout = (int)Math.Ceiling(request.RequestTimeout.TotalMilliseconds);