mirror of
https://github.com/home-assistant/core.git
synced 2025-12-25 05:26:47 +00:00
SSDP response decode: replace invalid utf-8 characters (#42681)
* SSDP response decode: replace invalid utf-8 characters * Add test to validate replaced data Co-authored-by: Joakim Plate <elupus@ecce.se>
This commit is contained in:
committed by
GitHub
parent
ca43b3a8bb
commit
ee55223065
@@ -245,9 +245,9 @@ class AiohttpClientMockResponse:
|
||||
"""Return mock response."""
|
||||
return self.response
|
||||
|
||||
async def text(self, encoding="utf-8"):
|
||||
async def text(self, encoding="utf-8", errors="strict"):
|
||||
"""Return mock response as a string."""
|
||||
return self.response.decode(encoding)
|
||||
return self.response.decode(encoding, errors=errors)
|
||||
|
||||
async def json(self, encoding="utf-8", content_type=None):
|
||||
"""Return mock response as a json."""
|
||||
|
||||
Reference in New Issue
Block a user