1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2025-06-05 21:49:31 +02:00

Updated shorthands.js

This commit is contained in:
nobody
2020-08-23 07:35:37 +02:00
parent f2a1eddd85
commit 4e9f5f4c6a
2 changed files with 8 additions and 77 deletions

View File

@@ -130,7 +130,7 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
for (let resourceMold of Object.keys(resourceMappings)) {
if (resourcePattern.startsWith(resourceMold)) {
let targetPath, hostShorthands, versionDelivered, versionRequested;
let targetPath, versionDelivered, versionRequested;
targetPath = resourceMappings[resourceMold].path;
targetPath = targetPath.replace(Resource.VERSION_PLACEHOLDER, versionNumber);
@@ -140,14 +140,7 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
versionRequested = versionNumber === null ? 'latest' : versionNumber[0];
hostShorthands = shorthands[channelHost];
if (hostShorthands && hostShorthands[targetPath]) {
let shorthand = hostShorthands[targetPath];
targetPath = shorthand.path;
versionDelivered = shorthand.version;
} else if (versionNumber === null) {
if (versionNumber === null) {
versionDelivered = targetPath.match(Resource.VERSION_EXPRESSION).toString();
}