Bootstrap: Redirect alpha and beta versions to the stable version (#1265)

This commit is contained in:
nobody 2022-12-18 07:45:41 +01:00
parent 6ecbcf1007
commit 24dd4ea41a
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
3 changed files with 6 additions and 1 deletions

View File

@ -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 = {

View File

@ -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);

View File

@ -46,6 +46,7 @@
<p>Improved</p>
<ul>
<li>HTML filter active by default (<a href="https://codeberg.org/nobody/LocalCDN/issues/1249">#1249</a>)</li>
<li>Bootstrap: Redirect alpha and beta versions to the stable version (<a href="https://codeberg.org/nobody/LocalCDN/issues/1265">#1265</a>)</li>
</ul>
</div>
<div id="generator-section">