This commit is contained in:
parent
496352a7ef
commit
335abfb6f6
@ -14,9 +14,9 @@ CLOUDPROXY_ENDPOINT = os.getenv("CLOUDPROXY_ENDPOINT")
|
||||
|
||||
|
||||
class FlareRequests(requests.Session):
|
||||
def request(self, method, url, params=None, **kwargs):
|
||||
def request(self, method, url, params=None, data=None, **kwargs):
|
||||
if not CLOUDPROXY_ENDPOINT:
|
||||
return super().request(method, url, params, **kwargs)
|
||||
return super().request(method, url, params, data, **kwargs)
|
||||
|
||||
sessions = requests.post(
|
||||
CLOUDPROXY_ENDPOINT, json={"cmd": "sessions.list"}
|
||||
@ -35,14 +35,16 @@ class FlareRequests(requests.Session):
|
||||
else:
|
||||
raise requests.RequestException(response)
|
||||
|
||||
url += "&" if len(url.split("?")) > 1 else "?"
|
||||
|
||||
post_data = {
|
||||
"cmd": f"request.{method.lower()}",
|
||||
"session": FLARESESSION,
|
||||
"url": url,
|
||||
"url": f"{url}{urllib.parse.urlencode(params)}",
|
||||
}
|
||||
|
||||
if params:
|
||||
post_data["postData"] = urllib.parse.urlencode(params)
|
||||
if data:
|
||||
post_data["postData"] = urllib.parse.urlencode(data)
|
||||
|
||||
try:
|
||||
response = requests.post(
|
||||
|
Loading…
Reference in New Issue
Block a user