style: format with ruff
This commit is contained in:
@@ -41,8 +41,10 @@ class Config:
|
|||||||
|
|
||||||
# Require binary content (reject recognizable formats)
|
# Require binary content (reject recognizable formats)
|
||||||
# Rejects content with known magic bytes (PNG, JPEG, PDF, etc.) and UTF-8 text.
|
# Rejects content with known magic bytes (PNG, JPEG, PDF, etc.) and UTF-8 text.
|
||||||
REQUIRE_BINARY = (
|
REQUIRE_BINARY = os.environ.get("FLASKPASTE_REQUIRE_BINARY", "0").lower() in (
|
||||||
os.environ.get("FLASKPASTE_REQUIRE_BINARY", "0").lower() in ("1", "true", "yes")
|
"1",
|
||||||
|
"true",
|
||||||
|
"yes",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Reverse proxy trust configuration
|
# Reverse proxy trust configuration
|
||||||
|
|||||||
39
fpaste
39
fpaste
@@ -710,10 +710,41 @@ def is_file_path(arg):
|
|||||||
# Check for common file extensions
|
# Check for common file extensions
|
||||||
if "." in arg and not arg.startswith("."):
|
if "." in arg and not arg.startswith("."):
|
||||||
ext = arg.rsplit(".", 1)[-1].lower()
|
ext = arg.rsplit(".", 1)[-1].lower()
|
||||||
if ext in ("txt", "md", "py", "js", "json", "yaml", "yml", "xml", "html",
|
if ext in (
|
||||||
"css", "sh", "bash", "c", "cpp", "h", "go", "rs", "java",
|
"txt",
|
||||||
"rb", "php", "sql", "log", "conf", "cfg", "ini", "png",
|
"md",
|
||||||
"jpg", "jpeg", "gif", "pdf", "zip", "tar", "gz"):
|
"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 True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user