diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/SanitizerTests.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/SanitizerTests.cs index ddfa38f7c95..483152b2957 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/SanitizerTests.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/SanitizerTests.cs @@ -668,24 +668,24 @@ public void UriStringSanitizerQuietlyExits(string targetValue, string replacemen } - [Theory] - [InlineData("batchresponse_00000000-0000-0000-0000-000000000000", "batchresponse_boundary", "Test.RecordEntries/multipart_request.json")] - [InlineData("changesetresponse_955358ab-62b1-4d6c-804b-41cebb7c5e42", "changeset_boundry", "Test.RecordEntries/multipart_request.json")] - public void GeneralRegexSanitizerAffectsMultipartRequest(string regex, string replacementValue, string targetFile) - { - var session = TestHelpers.LoadRecordSession(targetFile); + // Re-enable w/ Azure/azure-sdk-tools#2900 + //[Theory] + //[InlineData("batchresponse_00000000-0000-0000-0000-000000000000", "batchresponse_boundary", "Test.RecordEntries/multipart_request.json")] + //[InlineData("changesetresponse_955358ab-62b1-4d6c-804b-41cebb7c5e42", "changeset_boundry", "Test.RecordEntries/multipart_request.json")] + //public void GeneralRegexSanitizerAffectsMultipartRequest(string regex, string replacementValue, string targetFile) + //{ + // var session = TestHelpers.LoadRecordSession(targetFile); - var targetEntry = session.Session.Entries[0]; - var matcher = new RecordMatcher(); - - var sanitizer = new GeneralRegexSanitizer(value: replacementValue, regex: regex); - session.Session.Sanitize(sanitizer); + // var targetEntry = session.Session.Entries[0]; + // var matcher = new RecordMatcher(); - var bodyString = Encoding.UTF8.GetString(session.Session.Entries[0].Response.Body); + // var sanitizer = new GeneralRegexSanitizer(value: replacementValue, regex: regex); + // session.Session.Sanitize(sanitizer); - Assert.DoesNotContain(regex, bodyString); - Assert.Contains(replacementValue, bodyString); - } + // var bodyString = Encoding.UTF8.GetString(session.Session.Entries[0].Response.Body); + // Assert.DoesNotContain(regex, bodyString); + // Assert.Contains(replacementValue, bodyString); + //} } } diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/ContentTypeUtilities.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/ContentTypeUtilities.cs index cbdd8854f6e..7c925078a5a 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/ContentTypeUtilities.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/ContentTypeUtilities.cs @@ -19,7 +19,6 @@ public static bool TryGetTextEncoding(string contentType, out Encoding encoding) const string appJsonPrefix = "application/json"; const string xmlSuffix = "xml"; const string urlEncodedSuffix = "-urlencoded"; - const string multipartMixed = "multipart/mixed"; // Default is technically US-ASCII, but will default to UTF-8 which is a superset. const string appFormUrlEncoded = "application/x-www-form-urlencoded"; @@ -46,8 +45,7 @@ public static bool TryGetTextEncoding(string contentType, out Encoding encoding) contentType.EndsWith(xmlSuffix, StringComparison.OrdinalIgnoreCase) || contentType.EndsWith(urlEncodedSuffix, StringComparison.OrdinalIgnoreCase) || contentType.StartsWith(appJsonPrefix, StringComparison.OrdinalIgnoreCase) || - contentType.StartsWith(appFormUrlEncoded, StringComparison.OrdinalIgnoreCase) || - contentType.StartsWith(multipartMixed, StringComparison.OrdinalIgnoreCase)) + contentType.StartsWith(appFormUrlEncoded, StringComparison.OrdinalIgnoreCase)) { encoding = Encoding.UTF8; return true;