Skip to content

Commit

Permalink
[Test-Proxy] Address Matching issues for batch playback (#2310)
Browse files Browse the repository at this point in the history
* resolve matching issues for batch responses from python tables tests
* Update tools/test-proxy/Azure.Sdk.Tools.TestProxy/Sanitizers/BodyRegexSanitizer.cs to apply
  • Loading branch information
scbedd authored Nov 18, 2021
1 parent 0f6ff52 commit dfa21b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Azure.Sdk.Tools.TestProxy.Common;
using System;
using System.Text;

namespace Azure.Sdk.Tools.TestProxy.Sanitizers
{
Expand Down Expand Up @@ -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));
}
}
}

0 comments on commit dfa21b3

Please sign in to comment.