From 24dd4ea41adbaed530556304bc8ba74c907eda56 Mon Sep 17 00:00:00 2001 From: nobody Date: Sun, 18 Dec 2022 07:45:41 +0100 Subject: [PATCH] Bootstrap: Redirect alpha and beta versions to the stable version (#1265) --- core/constants.js | 3 ++- core/request-analyzer.js | 3 +++ pages/updates/updates.html | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/constants.js b/core/constants.js index 2fe09feb..38a75c27 100644 --- a/core/constants.js +++ b/core/constants.js @@ -271,7 +271,8 @@ const Regex = { 'FONT_AWESOME_WITH_CODE': /use\.fontawesome\.com\/[a-z0-9]{10}\.(js|css)/, 'FONT_AWESOME_FONTS_ONLY': /\/font-?awesome\/(?:\d{1,2}\.){1,3}\d{1,2}\/fonts\//, 'BOOTSTRAP_FONTS_ONLY': /\/bootstrap\/(?:\d{1,2}\.){1,3}\d{1,2}\/fonts\//, - 'ROCKET_LOADER': /ajax\.cloudflare\.com\/cdn-cgi\/scripts\/[a-zA-Z0-9]{8}\/cloudflare-static\/rocket-loader\.min\.js/ + 'ROCKET_LOADER': /ajax\.cloudflare\.com\/cdn-cgi\/scripts\/[a-zA-Z0-9]{8}\/cloudflare-static\/rocket-loader\.min\.js/, + 'TWITTER_BOOTSTRAP_ALPHA_BETA': /-(alpha|beta).?\d?/, }; const MaterialIcons = { diff --git a/core/request-analyzer.js b/core/request-analyzer.js index 0d862b79..60b4b03e 100644 --- a/core/request-analyzer.js +++ b/core/request-analyzer.js @@ -145,6 +145,9 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel let resourcePath, versionNumber, resourcePattern, shorthandResource; resourcePath = channelPath.replace(basePath, ''); + if (resourcePath.startsWith('bootstrap')) { + resourcePath = resourcePath.replace(Regex.TWITTER_BOOTSTRAP_ALPHA_BETA, ''); + } // Evaluate first in case of version 'latest' and numerals in resource versionNumber = resourcePath.match(Resource.VERSION_EXPRESSION); diff --git a/pages/updates/updates.html b/pages/updates/updates.html index fb8c4dfc..91999595 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -46,6 +46,7 @@

Improved