expand magic byte detection for common file formats

Add detection for:
- Images: BMP, TIFF, ICO
- Video: MP4, WebM, FLV, Matroska
- Audio: MP3, FLAC, OGG
- Documents: MS Office OLE (DOC/XLS/PPT)
- Executables: PE (EXE/DLL), ELF, Mach-O, WASM
- Archives: BZIP2, XZ, ZSTD, LZ4, 7z, RAR
- Data: SQLite

This improves REQUIRE_BINARY enforcement by detecting more
recognizable formats that should be encrypted before upload.
This commit is contained in:
Username
2025-12-25 19:47:33 +01:00
parent 9901649fd7
commit 764b831bb0
4 changed files with 52 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ A lightweight, secure pastebin REST API built with Flask.
- **Simple REST API** - Create, retrieve, list, and delete pastes via HTTP
- **Binary support** - Upload text, images, archives, and other binary content
- **Automatic MIME detection** - Magic byte detection (PNG, JPEG, GIF, WebP, ZIP, PDF, GZIP)
- **Automatic MIME detection** - Magic byte detection (images, video, audio, documents, executables, archives)
- **Client certificate authentication** - mTLS or header-based via reverse proxy
- **Tiered expiry** - 1 day (anon), 7 days (untrusted), 30 days (trusted PKI)
- **Size limits** - 3 MiB anonymous, 50 MiB authenticated