dshoreman / nextshot

A simple tool for taking screenshots on Linux and sharing via Nextcloud

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check MIME types for --file mode

dshoreman opened this issue · comments

Goes without saying, really. We don't want to be blindly uploading a massive .tar.gz (for example) and disguising it as a png when it's clearly not.

At least until the main pipeline's been rewritten for better error handling, it'd be best to add the check within parse_opts(). We can use file --mime-type <FILEPATH> to check. Add the -b flag and it'll suppress the filename too, which we don't particularly need.