Skip to content

Commit

Permalink
http: ignore errors when decoding response
Browse files Browse the repository at this point in the history
When we receive a http response, we try to decode its body.
However, we are now ignoring errors when trying to decode
to avoid unexpected errors arising from that
  • Loading branch information
lucasmoura committed Sep 20, 2024
1 parent 3ae91c9 commit 0055707
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions uaclient/http/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ def _readurl_pycurl_https_in_https(
req: request.Request,
timeout: Optional[int] = None,
https_proxy: Optional[str] = None,
decode_response: bool = True,
) -> UnparsedHTTPResponse:
try:
import pycurl
Expand Down Expand Up @@ -385,7 +384,7 @@ def readurl(
else:
resp = _readurl_urllib(req, timeout=timeout)

decoded_body = resp.body.decode("utf-8")
decoded_body = resp.body.decode("utf-8", errors="ignore")

json_dict = {}
json_list = []
Expand Down

0 comments on commit 0055707

Please sign in to comment.