Skip to content

Commit 25b8b41

Browse files
authored
fix(service): use base64.URLEncoding to encode the blob URL (#221)
Because - base64.StdEncoding might generate `/` in the Base64 string, which can break the structure of the generated blob URL. This commit: - Uses base64.URLEncoding to encode the blob URL.
1 parent aae7d94 commit 25b8b41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/service/object.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func EncodedMinioURLPath(namespaceID string, objectURLUUID uuid.UUID) string {
241241
// directly decode the base64 string to the presigned URL and forward the
242242
// request to MinIO.
243243
func encodeBlobURL(presignedURL *url.URL) (string, error) {
244-
presignedURLBase64 := base64.StdEncoding.EncodeToString([]byte(presignedURL.String()))
244+
presignedURLBase64 := base64.URLEncoding.EncodeToString([]byte(presignedURL.String()))
245245

246246
path, err := url.JoinPath(blobURLPath, presignedURLBase64)
247247
if err != nil {

0 commit comments

Comments
 (0)