From e2195c2745d6cc9db73b7fe1867ae2331aa4e9cc Mon Sep 17 00:00:00 2001 From: Oluwatosin Adewale Date: Sat, 25 May 2019 22:16:52 -0700 Subject: [PATCH] SingleValueReplacer.process_request properly decodes request.body if its type is byte. --- src/azure_devtools/scenario_tests/preparers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/azure_devtools/scenario_tests/preparers.py b/src/azure_devtools/scenario_tests/preparers.py index b777395..b10d8c9 100644 --- a/src/azure_devtools/scenario_tests/preparers.py +++ b/src/azure_devtools/scenario_tests/preparers.py @@ -105,7 +105,7 @@ def process_request(self, request): quote_plus(self.moniker)) if is_text_payload(request) and request.body: - body = str(request.body) + body = str(request.body, 'utf-8') if isinstance(request.body, bytes) else str(request.body) if self.random_name in body: request.body = body.replace(self.random_name, self.moniker)