diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/RecordingHandler.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/RecordingHandler.cs index 6feabe8a455..48dd483ec50 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/RecordingHandler.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/RecordingHandler.cs @@ -356,6 +356,7 @@ public async Task HandlePlaybackRequest(string recordingId, HttpRequest incoming var bodyData = CompressBody(match.Response.Body, match.Response.Headers); outgoingResponse.ContentLength = bodyData.Length; + await outgoingResponse.Body.WriteAsync(bodyData).ConfigureAwait(false); } } diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Sanitizers/BodyRegexSanitizer.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Sanitizers/BodyRegexSanitizer.cs index afb15cab076..5c07a20ad01 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Sanitizers/BodyRegexSanitizer.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Sanitizers/BodyRegexSanitizer.cs @@ -1,5 +1,6 @@ using Azure.Sdk.Tools.TestProxy.Common; using System; +using System.Text; namespace Azure.Sdk.Tools.TestProxy.Sanitizers { @@ -35,7 +36,7 @@ public override string SanitizeTextBody(string contentType, string body) public override byte[] SanitizeBody(string contentType, byte[] body) { - return body; + return Encoding.UTF8.GetBytes(StringSanitizer.SanitizeValue(Encoding.UTF8.GetString(body), _newValue, _regexValue, _groupForReplace)); } } }