Fix share link issue (#3382) (#3384)

This commit is contained in:
Ramon de Klein
2024-06-13 21:30:33 +02:00
committed by GitHub
parent fa32d78ff1
commit f4d98a4910
4 changed files with 32 additions and 23 deletions

View File

@@ -18,6 +18,7 @@ package api
import (
"context"
"encoding/base64"
"errors"
"fmt"
"io"
@@ -1022,7 +1023,9 @@ func getShareObjectURL(ctx context.Context, client MCClient, r *http.Request, ve
}
requestURL := getRequestURLWithScheme(r)
objURL := fmt.Sprintf("%s/api/v1/download-shared-object/%s", requestURL, url.PathEscape(minioURL))
encodedURL := base64.RawURLEncoding.EncodeToString([]byte(minioURL))
objURL := fmt.Sprintf("%s/api/v1/download-shared-object/%s", requestURL, url.PathEscape(encodedURL))
return &objURL, nil
}