Fix postData on GET
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Michel Roux 2022-12-21 17:20:16 +00:00
parent 8dc0b49e18
commit 0deb6b4284

View File

@ -8,15 +8,20 @@ class FlareRequests(Session):
if not CLOUDPROXY_ENDPOINT:
return super().request(method, url, params, timeout=timeout, **kwargs)
response = post(
CLOUDPROXY_ENDPOINT,
json={
post_data = {
"cmd": f"request.{method.lower()}",
"url": url,
"postData": parse.urlencode(params) if params else "",
"maxTimeout": timeout * 1000,
},
}
if params:
post_data["postData"] = parse.urlencode(params)
response = post(
CLOUDPROXY_ENDPOINT,
json=post_data,
)
solution = response.json()
if "solution" in solution: