JoeGandy / ShareX-Custom-Upload

A little PHP script created for uploading custom sharex files to your own webserver
MIT License
165 stars 50 forks source link

Fix MIME sniffing adding random extensions to .zip files #134

Closed davwheat closed 3 years ago

davwheat commented 3 years ago

Sometimes, zips should just be zips!

Example: https://u.davwheat.dev/4b1JoB.zip

This file is actually a flashable .zip file for Android phones, but because it has JAR-related stuff (META-INF, etc) the MIME sniffer thinks that it's a .jar instead, meaning Chrome on Android adds a .jar to the file after downloaded.


I've simplified the MIME override system I'd previously added. Now there's a simple array of overrides which can be added to in the future.