From 10d603f1c673bb2e042f78749da9b20b7f987e75 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sat, 24 Feb 2024 17:57:01 +0000 Subject: [PATCH] Accept application/octet-stream for CLI uploads --- t0pic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t0pic.py b/t0pic.py index 6885460..3df14b5 100644 --- a/t0pic.py +++ b/t0pic.py @@ -98,7 +98,8 @@ def new(): abort(400) # No file was uploaded pic = request.files['pic'] - if pic.mimetype not in ['image/png', 'image/jpeg', 'image/gif']: + + if pic.mimetype not in ['image/png', 'image/jpeg', 'image/gif', 'application/octet-stream']: print(f"Unsupported image format: {pic.mimetype}") abort(400) # Consider using a more specific status code or returning an error message