diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/RecordingHandler.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/RecordingHandler.cs index 5e033feaa7a..08511273dd8 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/RecordingHandler.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/RecordingHandler.cs @@ -457,16 +457,19 @@ public async Task HandlePlaybackRequest(string recordingId, HttpRequest incoming var sanitizers = SanitizerRegistry.GetSanitizers(session); - // we don't need to re-sanitize with recording-applicable sanitizers every time. just the very first one - lock (session) + if (!session.IsSanitized) { - if (!session.IsSanitized) + // we don't need to re-sanitize with recording-applicable sanitizers every time. just the very first one + lock (session) { - session.IsSanitized = true; - - foreach (RecordedTestSanitizer sanitizer in sanitizers) + if (!session.IsSanitized) { - session.Session.Sanitize(sanitizer); + foreach (RecordedTestSanitizer sanitizer in sanitizers) + { + session.Session.Sanitize(sanitizer); + } + + session.IsSanitized = true; } } }