]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 10 Jun 2023 00:10:02 +0000 (02:10 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 10 Jun 2023 00:10:02 +0000 (02:10 +0200)
- removed redundant initialization of 'blockdict'
- removed local variable 'csrf'

fba/commands.py
fba/csrf.py

index ab601c9c26d21b851006537026dccce954361885..849e13cce5c3b8e8ef96e321fd2c4eeb1416e03e 100644 (file)
@@ -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):
index 8a11dadd39d96bcca72c7f179f20427e6aca980d..1d22ccbf796846daddf1d50296fde29cb5ae0ec5 100644 (file)
@@ -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}")