inabahare / lewd2

A based file uploader
https://lewd.se
GNU General Public License v3.0
23 stars 3 forks source link

Link returned does not handle spaces well #37

Closed kattjevfel closed 5 years ago

kattjevfel commented 5 years ago

When uploading a file with spaces they are not replaced with %20, resulting in broken links like below.

$ curl -X POST -F "file=@file with spaces.svg" -H "token: <redacted>" https://lewd.se/upload
{"status":200,"data":{"link":"https://u.lewd.se/833980f7a82e_file with spaces.svg","deleteionURL":"https://lewd.se/delete/<redacted>"}}

Expected output would be https://u.lewd.se/833980f7a82e_file%20with%20spaces.svg

inabahare commented 5 years ago

The deed has been done!

inaba@japan:~$ curl -X POST -F "file=@NOT A VIRUS.bat" -H "token: JimmyCarr" http://localhost:3000/upload
{"status":200,"data":{"link":"http://localhost:3000/uploads/e5965aff7d66_NOT%20A%20VIRUS.bat","deleteionURL":"http://localhost:3000/delete/8709c191-11e4-11e9-ae6f-691a947b771d"}}
inaba@japan:~$