Strip ../ and ./ prefixes from filenames when uploading dirs to Skynet
PROGRAMMING TASK
Description of Task
When uploading a directory to Skynet, we should first strip any filenames prefixed with ../
and ./
.
I started fixing it in one of the SDKs but realized that if we fix it once in the Skynet code we don't have to replicate the fix for every SDK.
Reason or Need for Change
Let's say I'm uploading a directory ../test
from the current dir. Each resulting filename will start with ../
and will live at <portal url>/<skylink>/../test
and be difficult if not impossible to access.
I've tested this and wasn't able to get to the files.
Design / Proposal
In skyfileParseMultiPartRequest()
left-trim the filenames.