Skip to content

Commit c9958aa

Browse files
committed
update the fix of the multiple x-ms-unique-id values issue
1 parent fb62ca1 commit c9958aa

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/Accounts/Accounts/CommonModule/AzModule.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ public void OnModuleLoad(string resourceId, string moduleName, PipelineChangeDel
100100
{
101101
// this will be called once when the module starts up
102102
// the common module can prepend or append steps to the pipeline at this point.
103-
prependStep(UniqueId.Instance.SendAsync);
104103
}
105104

106105
/// <summary>

src/Accounts/Accounts/CommonModule/ContextAdapter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ internal string SelectedProfile
7373
/// <param name="appendStep">a delegate which allows the module to append a step in the HTTP Pipeline</param>
7474
public void OnNewRequest(InvocationInfo invocationInfo, string correlationId, string processRecordId, PipelineChangeDelegate prependStep, PipelineChangeDelegate appendStep)
7575
{
76+
prependStep(UniqueId.Instance.SendAsync);
7677
appendStep(new UserAgent(invocationInfo).SendAsync);
7778
appendStep(this.SendHandler(GetDefaultContext(_provider, invocationInfo), AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId));
7879
}

src/Accounts/Accounts/CommonModule/UniqueId.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,8 @@ public class UniqueId
4343
/// <returns>Amended pipeline for retrieving a response</returns>
4444
public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken token, Action cancel, SignalDelegate signal, NextDelegate next)
4545
{
46-
if (!request.Headers.Contains("x-ms-unique-id"))
47-
{
48-
// add a header...
49-
request.Headers.Add("x-ms-unique-id", Interlocked.Increment(ref this.count).ToString());
50-
}
46+
// add a header...
47+
request.Headers.Add("x-ms-unique-id", Interlocked.Increment(ref this.count).ToString());
5148
// continue with pipeline.
5249
return next(request, token, cancel, signal);
5350
}

0 commit comments

Comments
 (0)