Uploading a file with no file extension skips MIME type detection and gets stored/served with the file name as the extension
Environment
- Installation type:
-
The virgin OTP install -
The chad source install
-
- Pleroma version (could be found in the "Version" tab of settings in Pleroma-FE): 44b2a137
- Elixir version (
elixir -v
for from source installations, N/A for OTP):Erlang/OTP 23 [erts-11.1.1] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]
Elixir 1.10.4 (compiled with Erlang/OTP 23)
- Operating system: btw i use arch
- PostgreSQL version (
psql -V
):psql (PostgreSQL) 12.4
- Rum indexes:
-
No -
Yes
-
Bug description
When ploading a file without a file extension, the name of the file is used as the extension. E.g. if you upload a jpeg named "sad" the file will be stored as $sha256.sad
. This makes dedupe sad and less effective.
However, uploading a file with the incorrect file extension gets assigned the correct file extension as expected. E.g. if you upload a jpeg named "sad.mp4" the file will be stored as $sha256.jpg
.
I can't say for certain when this bug first appeared but I'm fairly certain that it was introduced within the last 2-4 days.