Permalink
Browse files

update RemoteLogStreamManager due to credentials change

  • Loading branch information...
1 parent 0903116 commit 335faa839b3c9bdb135132983efca918ea7c9408 @suwatch suwatch committed Dec 6, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 Kudu.TestHarness/RemoteLogStreamManager.cs
@@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Net;
+using System.Text;
using System.Threading.Tasks;
using Kudu.Client.Infrastructure;
@@ -20,9 +21,11 @@ public Task<Stream> GetStream()
TaskCompletionSource<Stream> tcs = new TaskCompletionSource<Stream>();
RequestState state = new RequestState { Manager = this, TaskCompletionSource = tcs, Request = request };
- if (Client.DefaultRequestHeaders.Authorization != null)
+ if (Credentials != null)
{
- request.Headers["Authorization"] = Client.DefaultRequestHeaders.Authorization.Scheme + " " + Client.DefaultRequestHeaders.Authorization.Parameter;
+ NetworkCredential networkCred = Credentials.GetCredential(Client.BaseAddress, "Basic");
+ string credParameter = Convert.ToBase64String(Encoding.ASCII.GetBytes(networkCred.UserName + ":" + networkCred.Password));
+ request.Headers["Authorization"] = "Basic " + credParameter;
}
IAsyncResult result = request.BeginGetResponse(RemoteLogStreamManager.OnGetResponse, state);

0 comments on commit 335faa8

Please sign in to comment.