From 7c33822caa11a1d3b3a9c14fbf1448190b516925 Mon Sep 17 00:00:00 2001 From: nobody Date: Mon, 19 Sep 2022 18:17:30 +0200 Subject: [PATCH] Consider two-digit weird version numbers (#1139) --- core/constants.js | 2 +- core/request-analyzer.js | 2 +- pages/updates/updates.html | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/constants.js b/core/constants.js index 91e5ea3d..fa5ad6dc 100644 --- a/core/constants.js +++ b/core/constants.js @@ -55,7 +55,7 @@ const MessageResponse = { const Resource = { 'MAPPING_EXPRESSION': /\.map$/i, 'VERSION_EXPRESSION': /(?:\d{1,2}\.){1,3}\d{1,2}(?:-\d)?|latest/, - 'SINGLE_NUMBER_EXPRESSION': /^\D+@?\d.*$/, + 'SINGLE_NUMBER_EXPRESSION': /^\D+@?\d{1,2}\D*$/, 'MATHJAX': /\/\w.*(?:\d{1,2}\.){1,3}\d{1,2}(?:-\d)?\/|\/(mathjax\/)?latest\//, 'TINYMCE': /\/\w.*(?:\d{1,2}\.){1,3}\d{1,2}(?:-\d)?\//, 'VERSION_PLACEHOLDER': '{version}' diff --git a/core/request-analyzer.js b/core/request-analyzer.js index 684c0ae2..7f5370c0 100644 --- a/core/request-analyzer.js +++ b/core/request-analyzer.js @@ -151,7 +151,7 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel // Handle weird version expressions if (!versionNumber && Resource.SINGLE_NUMBER_EXPRESSION.test(channelPath)) { - versionNumber = channelPath.match(/\d/); + versionNumber = channelPath.match(/\d{1,2}/); resourcePattern = resourcePath.replaceAll(versionNumber, Resource.VERSION_PLACEHOLDER); versionNumber = [`${versionNumber}.0`]; } else { diff --git a/pages/updates/updates.html b/pages/updates/updates.html index 3291b6b9..4a826760 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -25,6 +25,10 @@

New in LocalCDN:

+

Improved

+

Fixed