File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ function importOriginalImage() {
1818 // Assemble the image request
1919 const request = {
2020 bucket : bucketName ,
21- key : keyName
21+ key : encodeURIComponent ( keyName )
2222 }
2323 const strRequest = JSON . stringify ( request ) ;
2424 const encRequest = btoa ( strRequest ) ;
@@ -77,7 +77,7 @@ function getPreviewImage() {
7777 // Set up the request body
7878 const request = {
7979 bucket : bucketName ,
80- key : keyName ,
80+ key : encodeURIComponent ( keyName ) ,
8181 edits : _edits
8282 }
8383 if ( Object . keys ( request . edits ) . length === 0 ) { delete request . edits }
Original file line number Diff line number Diff line change @@ -443,7 +443,7 @@ export class ImageHandler {
443443 alpha : string ,
444444 sourceImageMetadata : sharp . Metadata
445445 ) : Promise < Buffer > {
446- const params = { Bucket : bucket , Key : key } ;
446+ const params = { Bucket : bucket , Key : decodeURIComponent ( key ) } ;
447447 try {
448448 const { width, height } = sourceImageMetadata ;
449449 const overlayImage : S3 . GetObjectOutput = await this . s3Client . getObject ( params ) . promise ( ) ;
Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ export class ImageRequest {
269269 if ( requestType === RequestTypes . DEFAULT ) {
270270 // Decode the image request and return the image key
271271 const { key } = this . decodeRequest ( event ) ;
272- return key ;
272+ return decodeURIComponent ( key ) ;
273273 }
274274
275275 if ( requestType === RequestTypes . THUMBOR || requestType === RequestTypes . CUSTOM ) {
You can’t perform that action at this time.
0 commit comments