Skip to content

Commit

Permalink
Improve getting the s3 key from various filename conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
Arpee Ong committed Jul 28, 2019
1 parent 2f1bf56 commit 4993496
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/image-handler/image-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class ImageRequest {
//return key[key.length - 1];

//Arpee: Support serving images under s3 subdirectories
return decodeURIComponent(event["path"].replace(/\d+x\d+|\/filters[:-][^/;]+|\/fit-in\/+|^\/+/g,'').replace(/^\//,''));
return decodeURIComponent(event["path"].replace(/\d+x\d+\/|filters[:-][^/;]+|\/fit-in\/+|^\/+/g,'').replace(/^\/+/,''));
} else {
// Return an error for all other conditions
throw ({
Expand Down

0 comments on commit 4993496

Please sign in to comment.