Skip to content

Commit 0984e95

Browse files
authored
Update ISendAsync.cs (#662)
* Update ISendAsync.cs pass only Authorization to next header for long running operations. * Update ISendAsync.cs * Update ISendAsync.cs fix potential null reference * Update ISendAsync.cs * Update ISendAsync.cs * Update ISendAsync.cs
1 parent a9da10f commit 0984e95

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

powershell/resources/runtime/csharp/pipeline/ISendAsync.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,19 @@ internal static HttpRequestMessage Clone(this HttpRequestMessage original, Syste
252252
{
253253
clone.Properties.Add(prop);
254254
}
255-
255+
256256
foreach (KeyValuePair<string, IEnumerable<string>> header in original.Headers)
257-
{
257+
{
258+
/*
259+
**temporarily skip cloning telemetry related headers**
258260
clone.Headers.TryAddWithoutValidation(header.Key, header.Value);
261+
*/
262+
if (!"x-ms-unique-id".Equals(header.Key) && !"x-ms-client-request-id".Equals(header.Key) && !"CommandName".Equals(header.Key) && !"FullCommandName".Equals(header.Key) && !"ParameterSetName".Equals(header.Key) && !"User-Agent".Equals(header.Key))
263+
{
264+
clone.Headers.TryAddWithoutValidation(header.Key, header.Value);
265+
}
259266
}
260-
267+
261268
return clone;
262269
}
263270

@@ -286,4 +293,4 @@ internal static async Task<HttpRequestMessage> CloneWithContent(this HttpRequest
286293
return clone;
287294
}
288295
}
289-
}
296+
}

0 commit comments

Comments
 (0)