redirect outdated paths of font-awesome
This commit is contained in:
parent
67d4f0016f
commit
37c3e99921
|
@ -37,6 +37,7 @@
|
|||
"GoogleDomains": true,
|
||||
"ReqAnalyzer": true,
|
||||
"MathJax3Files": true,
|
||||
"RedirectMap": true,
|
||||
|
||||
"fileGuard": true,
|
||||
"files": true,
|
||||
|
|
|
@ -466,6 +466,13 @@ const LogString = {
|
|||
'IFRAME': 'Possible iframe request:',
|
||||
};
|
||||
|
||||
const RedirectMap = {
|
||||
'resources/font-awesome/3.2.1/css/all.min.css': 'resources/font-awesome/3.2.1/css/font-awesome.min.css',
|
||||
'resources/font-awesome/3.2.1/css/all.css': 'resources/font-awesome/3.2.1/css/font-awesome.min.css',
|
||||
'resources/font-awesome/4.7.0/css/all.min.css': 'resources/font-awesome/4.7.0/css/font-awesome.min.css',
|
||||
'resources/font-awesome/4.7.0/css/all.css': 'resources/font-awesome/4.7.0/css/font-awesome.min.css'
|
||||
};
|
||||
|
||||
/**
|
||||
* https://codeberg.org/nobody/LocalCDN/issues/1560
|
||||
*/
|
||||
|
|
|
@ -223,6 +223,8 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
|
|||
break;
|
||||
}
|
||||
|
||||
targetPath = requestAnalyzer._redirectTargetFile(targetPath);
|
||||
|
||||
// Prepare and return a local target.
|
||||
return {
|
||||
'source': channelHost,
|
||||
|
@ -248,6 +250,11 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
|
|||
};
|
||||
};
|
||||
|
||||
requestAnalyzer._redirectTargetFile = function (targetPath) {
|
||||
return RedirectMap[targetPath] || targetPath;
|
||||
};
|
||||
|
||||
|
||||
requestAnalyzer._getPathOfBundle = function (initiator, channelHost, channelPath, targetPath, bundle) {
|
||||
let filename = channelPath.split('/').pop();
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
<h2>New in LocalCDN:</h2>
|
||||
</div>
|
||||
<div class="release-notes-area">
|
||||
<p></p>
|
||||
<p>Improved</p>
|
||||
<ul>
|
||||
<li></li>
|
||||
<li>redirect outdated paths of font-awesome</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="generator-section">
|
||||
|
|
Loading…
Reference in New Issue