Skip to content

Commit 16fc733

Browse files
committed
refactor(storage): clearer per-segment key encoding in fallback URL
1 parent cf4129f commit 16fc733

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/sim/lib/uploads/providers/s3/client.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,10 @@ export async function getS3MultipartPartUrls(
399399
* keys containing spaces or reserved characters still yield a valid URL.
400400
*/
401401
function buildObjectFallbackUrl(bucket: string, region: string, key: string): string {
402-
const encodedKey = key.split('/').map(encodeURIComponent).join('/')
402+
const encodedKey = key
403+
.split('/')
404+
.map((segment) => encodeURIComponent(segment))
405+
.join('/')
403406
if (S3_CONFIG.endpoint) {
404407
const base = S3_CONFIG.endpoint.replace(/\/+$/, '')
405408
if (S3_CONFIG.forcePathStyle) {

0 commit comments

Comments
 (0)