From ded423e4a2504d182038af5b5c72f9dad5f41457 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 10 Jun 2023 02:10:02 +0200 Subject: [PATCH] Continued: - removed redundant initialization of 'blockdict' - removed local variable 'csrf' --- fba/commands.py | 2 -- fba/csrf.py | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/fba/commands.py b/fba/commands.py index ab601c9..849e13c 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -253,8 +253,6 @@ def fetch_blocks(args: argparse.Namespace): if config.get("bot_enabled") and len(blockdict) > 0: network.send_bot_post(blocker, blockdict) - blockdict = [] - # DEBUG: print("DEBUG: EXIT!") def fetch_cs(args: argparse.Namespace): diff --git a/fba/csrf.py b/fba/csrf.py index 8a11dad..1d22ccb 100644 --- a/fba/csrf.py +++ b/fba/csrf.py @@ -53,9 +53,8 @@ def determine(domain: str, headers: dict) -> dict: tag = meta.find("meta", attrs={"name": "csrf-token"}) # DEBUG: print(f"DEBUG: tag={tag}") - csrf = tag["content"] - # DEBUG: print(f"DEBUG: Adding CSRF token='{csrf}' for domain='{domain}'") - reqheaders["X-CSRF-Token"] = csrf + # DEBUG: print(f"DEBUG: Adding CSRF token='{tag['content']}' for domain='{domain}'") + reqheaders["X-CSRF-Token"] = tag["content"] except BaseException as exception: # DEBUG: print(f"DEBUG: No CSRF token found, using normal headers: domain='{domain}',exception[{type(exception)}]={exception}") -- 2.39.5