From f3f73a4fd6d1a16a97b94f57bd3c905e2dcd8302 Mon Sep 17 00:00:00 2001 From: Brian Savelkouls Date: Mon, 16 Jan 2023 19:27:06 +0000 Subject: [PATCH] decode response with errors --- seleniumwire/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seleniumwire/utils.py b/seleniumwire/utils.py index 9745707..2ba4a99 100644 --- a/seleniumwire/utils.py +++ b/seleniumwire/utils.py @@ -184,7 +184,7 @@ def urlsafe_address(address): return addr, port -def decode(data: bytes, encoding: str) -> bytes: +def decode(data: bytes, encoding: str, errors='strict') -> bytes: """Attempt to decode data based on the supplied encoding. If decoding fails a ValueError is raised. @@ -195,4 +195,4 @@ def decode(data: bytes, encoding: str) -> bytes: Returns: The decoded data. Raises: ValueError if the data could not be decoded. """ - return decoder.decode(data, encoding) + return decoder.decode(data, encoding, errors)