mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 00:53:57 -07:00
Send Http auth without waiting for challenge.
This commit is contained in:
parent
70494c3674
commit
2d96914bfa
4 changed files with 8 additions and 16 deletions
|
@ -98,7 +98,13 @@ namespace NzbDrone.Common.Http
|
|||
request.Method = Method;
|
||||
request.SuppressHttpError = SuppressHttpError;
|
||||
request.AllowAutoRedirect = AllowAutoRedirect;
|
||||
request.NetworkCredential = NetworkCredential;
|
||||
|
||||
if (NetworkCredential != null)
|
||||
{
|
||||
var authInfo = NetworkCredential.UserName + ":" + NetworkCredential.Password;
|
||||
authInfo = Convert.ToBase64String(Encoding.GetEncoding("ISO-8859-1").GetBytes(authInfo));
|
||||
request.Headers.Set("Authorization", "Basic " + authInfo);
|
||||
}
|
||||
|
||||
foreach (var header in Headers)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue