From d364c954d846030e1ffc4796181793f99040bfe6 Mon Sep 17 00:00:00 2001 From: Username Date: Sat, 20 Dec 2025 18:32:47 +0100 Subject: [PATCH] style: format with ruff --- app/config.py | 6 ++++-- fpaste | 39 +++++++++++++++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/app/config.py b/app/config.py index eda7280..b3afad9 100644 --- a/app/config.py +++ b/app/config.py @@ -41,8 +41,10 @@ class Config: # Require binary content (reject recognizable formats) # Rejects content with known magic bytes (PNG, JPEG, PDF, etc.) and UTF-8 text. - REQUIRE_BINARY = ( - os.environ.get("FLASKPASTE_REQUIRE_BINARY", "0").lower() in ("1", "true", "yes") + REQUIRE_BINARY = os.environ.get("FLASKPASTE_REQUIRE_BINARY", "0").lower() in ( + "1", + "true", + "yes", ) # Reverse proxy trust configuration diff --git a/fpaste b/fpaste index c0a42b6..fccf739 100755 --- a/fpaste +++ b/fpaste @@ -710,10 +710,41 @@ def is_file_path(arg): # Check for common file extensions if "." in arg and not arg.startswith("."): ext = arg.rsplit(".", 1)[-1].lower() - if ext in ("txt", "md", "py", "js", "json", "yaml", "yml", "xml", "html", - "css", "sh", "bash", "c", "cpp", "h", "go", "rs", "java", - "rb", "php", "sql", "log", "conf", "cfg", "ini", "png", - "jpg", "jpeg", "gif", "pdf", "zip", "tar", "gz"): + if ext in ( + "txt", + "md", + "py", + "js", + "json", + "yaml", + "yml", + "xml", + "html", + "css", + "sh", + "bash", + "c", + "cpp", + "h", + "go", + "rs", + "java", + "rb", + "php", + "sql", + "log", + "conf", + "cfg", + "ini", + "png", + "jpg", + "jpeg", + "gif", + "pdf", + "zip", + "tar", + "gz", + ): return True return False