Skip to content

Commit bb2433e

Browse files
authored
fix(vcr): fix middleware incompatability with request bodies that aren't utf-8 decodable (#233)
* fix & rel note
1 parent e43d44b commit bb2433e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ddapm_test_agent/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ async def _vcr_proxy_cassette_prefix(request: Request) -> Optional[str]:
118118
request_body: dict[str, str] = await request.json()
119119
requested_test_name = request_body.get("test_name")
120120
return requested_test_name
121-
except json.JSONDecodeError:
121+
except (json.JSONDecodeError, UnicodeDecodeError):
122122
return None
123123

124124

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
fixes:
3+
- |
4+
vcr: fixes an issue where the vcr cassette name middleware would not properly ignore decoding errors for request bodies that were not associated with then ``/vcr/test/start`` path.

0 commit comments

Comments
 (0)