From: Roland Häder Date: Sat, 10 Jun 2023 00:10:02 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ded423e4a2504d182038af5b5c72f9dad5f41457;p=fba.git Continued: - removed redundant initialization of 'blockdict' - removed local variable 'csrf' --- 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}")