Fix encoding
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Michel Roux 2023-01-05 20:50:17 +01:00
parent 125d0bde2d
commit 91143c6f1e

View File

@ -29,6 +29,7 @@ class FlareRequests(Session):
solution = response.json()
if "solution" in solution:
encoding = None
headers = solution["solution"]["headers"]
if "content-type" in headers:
content_type = headers["content-type"].split(";")
@ -43,7 +44,7 @@ class FlareRequests(Session):
resolved.headers = headers
resolved.raw = BytesIO(solution["solution"]["response"].encode())
resolved.url = url
resolved.encoding = encoding or None
resolved.encoding = encoding
resolved.reason = solution["status"]
resolved.cookies = solution["solution"]["cookies"]