From 33d586c91c9acf4216db58baf83bdd4eac9f2a8e Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Thu, 10 Sep 2020 09:28:11 -0700 Subject: [PATCH] GeneralNameReplacer correctly handles bytes bodies --- .../src/azure_devtools/scenario_tests/recording_processors.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py index 1c84dabacd4b..2ed25b3505a5 100644 --- a/tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py @@ -2,6 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- +import six from .utilities import is_text_payload, is_json_payload @@ -177,7 +178,7 @@ def process_request(self, request): request.uri = request.uri.replace(old, new) if is_text_payload(request) and request.body: - body = str(request.body) + body = six.ensure_str(request.body) if old in body: request.body = body.replace(old, new)