@@ -36,11 +36,9 @@ function getFileUrl(dataSourceConfig: DataSourceDataType, bucket: string, fileKe
36
36
return "" ;
37
37
}
38
38
if ( dataSourceConfig . endpointUrl ) {
39
- return `${ dataSourceConfig . endpointUrl } /${ bucket } /${ encodeURIComponent ( fileKey ) } ` ;
39
+ return `${ dataSourceConfig . endpointUrl } /${ bucket } /${ fileKey } ` ;
40
40
}
41
- return `https://s3.${ dataSourceConfig . region } .amazonaws.com/${ bucket } /${ encodeURIComponent (
42
- fileKey
43
- ) } `;
41
+ return `https://s3.${ dataSourceConfig . region } .amazonaws.com/${ bucket } /${ fileKey } ` ;
44
42
}
45
43
46
44
async function getFileSignedUrl ( bucket : string , fileName : string , client : S3Client ) {
@@ -105,7 +103,7 @@ export default async function run(
105
103
signedUrl = await getFileSignedUrl ( bucket , i . Key , client ) ;
106
104
}
107
105
files . push ( {
108
- name : decodeURIComponent ( i . Key || "" ) ,
106
+ name : i . Key || "" ,
109
107
size : i . Size ,
110
108
lastModified : i . LastModified ,
111
109
signedUrl,
@@ -120,7 +118,7 @@ export default async function run(
120
118
const res = await client . send (
121
119
new GetObjectCommand ( {
122
120
Bucket : bucket ,
123
- Key : encodeURIComponent ( action . fileName ) ,
121
+ Key : action . fileName ,
124
122
} )
125
123
) ;
126
124
const data = ( await res . Body ?. transformToString ( action . encoding || "base64" ) ) || "" ;
@@ -138,7 +136,7 @@ export default async function run(
138
136
new PutObjectCommand ( {
139
137
Body : Buffer . from ( action . data , ( action . encoding || "base64" ) as BufferEncoding ) ,
140
138
Bucket : bucket ,
141
- Key : encodeURIComponent ( action . fileName ) ,
139
+ Key : action . fileName ,
142
140
ContentType : action . contentType ,
143
141
} )
144
142
) ;
@@ -158,7 +156,7 @@ export default async function run(
158
156
await client . send (
159
157
new DeleteObjectCommand ( {
160
158
Bucket : bucket ,
161
- Key : encodeURIComponent ( action . fileName ) ,
159
+ Key : action . fileName ,
162
160
} )
163
161
) ;
164
162
return {
0 commit comments