From b2fa11e4432e385c604b4877e24e6a7d482b4e55 Mon Sep 17 00:00:00 2001 From: Damandeep Singh Date: Wed, 19 Feb 2025 15:50:07 +0530 Subject: [PATCH] fix: getFileExtension to accept a trailing slash --- src/js/utils/url.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/utils/url.js b/src/js/utils/url.js index 2967bfde02..e6ae943fa1 100644 --- a/src/js/utils/url.js +++ b/src/js/utils/url.js @@ -47,7 +47,7 @@ export const getAbsoluteURL = function(url) { */ export const getFileExtension = function(path) { if (typeof path === 'string') { - const splitPathRe = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/; + const splitPathRe = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.*([^\.\/\?]+)))(?:[\/]*|[\?].*)$/; const pathParts = splitPathRe.exec(path); if (pathParts) {