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 @@ namespace NzbDrone.Common.Http.Dispatchers
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 @@ namespace NzbDrone.Common.Http.Dispatchers
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);