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: if not CLOUDPROXY_ENDPOINT:
return super().request(method, url, params, timeout=timeout, **kwargs) return super().request(method, url, params, timeout=timeout, **kwargs)
response = post( post_data = {
CLOUDPROXY_ENDPOINT,
json={
"cmd": f"request.{method.lower()}", "cmd": f"request.{method.lower()}",
"url": url, "url": url,
"postData": parse.urlencode(params) if params else "",
"maxTimeout": timeout * 1000, "maxTimeout": timeout * 1000,
}, }
if params:
post_data["postData"] = parse.urlencode(params)
response = post(
CLOUDPROXY_ENDPOINT,
json=post_data,
) )
solution = response.json() solution = response.json()
if "solution" in solution: if "solution" in solution: