fix: avoid URL unsafe chars in multipart upload ID (#16034)

This commit is contained in:
Aditya Manthramurthy
2022-11-09 16:41:16 -08:00
committed by GitHub
parent 40a2c6b882
commit 5f1999cc71
3 changed files with 6 additions and 5 deletions

View File

@@ -43,7 +43,7 @@ import (
func (er erasureObjects) getUploadIDDir(bucket, object, uploadID string) string {
uploadUUID := uploadID
uploadBytes, err := base64.StdEncoding.DecodeString(uploadID)
uploadBytes, err := base64.RawURLEncoding.DecodeString(uploadID)
if err == nil {
slc := strings.SplitN(string(uploadBytes), ".", 2)
if len(slc) == 2 {
@@ -432,7 +432,7 @@ func (er erasureObjects) newMultipartUpload(ctx context.Context, bucket string,
partsMetadata[index].Metadata = userDefined
}
uploadUUID := mustGetUUID()
uploadID := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s.%s", globalDeploymentID, uploadUUID)))
uploadID := base64.RawURLEncoding.EncodeToString([]byte(fmt.Sprintf("%s.%s", globalDeploymentID, uploadUUID)))
uploadIDPath := er.getUploadIDDir(bucket, object, uploadUUID)
// Write updated `xl.meta` to all disks.