browser: fix file uploads with '#' in the name (#11261)

When the file name or the prefix contains `#`,
whatever comes after is ingored.

This is fixed by encoding the object path using
encodeURIComponent.

Fixes #11112
This commit is contained in:
Kanagaraj M
2021-01-13 02:17:46 +05:30
committed by GitHub
parent 1a5775e2e8
commit e09196d626
3 changed files with 50 additions and 47 deletions

View File

@@ -94,7 +94,7 @@ export const uploadFile = file => {
_filePath = _filePath.substring(1)
}
const filePath = _filePath
const objectName = `${currentPrefix}${filePath}`
const objectName = encodeURIComponent(`${currentPrefix}${filePath}`)
const uploadUrl = `${
window.location.origin
}${minioBrowserPrefix}/upload/${currentBucket}/${objectName}`