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