File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
servers/fdr/src/services/s3 Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -223,14 +223,23 @@ export class S3ServiceImpl implements S3Service {
223
223
input . ContentType = "image/svg+xml" ;
224
224
}
225
225
const command = new PutObjectCommand ( input ) ;
226
- return {
226
+ const result = {
227
227
url : await getSignedUrl (
228
228
isPrivate ? this . privateDocsS3 : this . publicDocsS3 ,
229
229
command ,
230
230
{ expiresIn : 3600 }
231
231
) ,
232
232
key,
233
233
} ;
234
+ if ( ! isPrivate ) {
235
+ try {
236
+ const url = new URL ( result . url ) ;
237
+ result . url = result . url . replace ( url . host , this . publicDocsCDNUrl ) ;
238
+ } catch ( error ) {
239
+ console . error ( "Failed to replace S3 URL with CDN URL:" , error ) ;
240
+ }
241
+ }
242
+ return result ;
234
243
}
235
244
236
245
async getPresignedApiDefinitionSourceDownloadUrl ( {
You can’t perform that action at this time.
0 commit comments