diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/RecordingHandler.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/RecordingHandler.cs index 80984d64e7a..2fca151d598 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/RecordingHandler.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/RecordingHandler.cs @@ -477,14 +477,11 @@ public static async Task> CreateEntryAsync(HttpReques entry.RequestUri = GetRequestUri(request).AbsoluteUri; entry.RequestMethod = new RequestMethod(request.Method); - lock (request.Headers) + foreach (var header in request.Headers) { - foreach (var header in request.Headers) + if (IncludeHeader(header.Key)) { - if (IncludeHeader(header.Key)) - { - entry.Request.Headers.Add(header.Key, header.Value.ToArray()); - } + entry.Request.Headers.Add(header.Key, header.Value.ToArray()); } }