Skip to content

Commit a9cca7d

Browse files
adewaleolmazuel
authored andcommitted
SingleValueReplacer.process_request properly decodes request.body if its type is byte. (#56)
1 parent d673282 commit a9cca7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/azure_devtools/scenario_tests/preparers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def process_request(self, request):
105105
quote_plus(self.moniker))
106106

107107
if is_text_payload(request) and request.body:
108-
body = str(request.body)
108+
body = str(request.body, 'utf-8') if isinstance(request.body, bytes) else str(request.body)
109109
if self.random_name in body:
110110
request.body = body.replace(self.random_name, self.moniker)
111111

0 commit comments

Comments
 (0)