Generic Package Registry: Fix a bug when downloading files with "+" symbol
Context
In Support directory structure in generic package ... (!153449 - merged), we allowed to download/upload files that their names contain /
. That means users can upload directory structured files to the Generic Package Repository.
To do that, we are encoding the filename before saving it in the database. So, if the filename is path/to/file.txt
, it will be encoded to path%2Fto%2Ffile.txt
.
The problem is when we have a filename that contains +
symbol. For example, a file named dummy+file.txt
will be encoded to dummy%2Bfile.txt
.
This caused the customers are unable to download any existing files that their names include +
symbol.
Solution
We need to only encode filenames that have the directory structure. Other than that, we don't encode it.
Edited by Moaz Khalifa