1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2024-12-23 00:25:15 +01:00

Improved: Version not found (#162)

This commit is contained in:
nobody 2020-11-03 20:46:43 +01:00
parent b42e1dd83c
commit e9dd0799a0
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
2 changed files with 6 additions and 1 deletions

View File

@ -141,7 +141,11 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
targetPath = resourceMappings[resourceMold].path;
targetPath = targetPath.replace(Resource.VERSION_PLACEHOLDER, versionNumber);
// Replace the requested version with the latest depending on major version
versionDelivered = helpers.setLastVersion(targetPath, versionNumber).toString();
versionDelivered = helpers.setLastVersion(targetPath, versionNumber);
if (versionDelivered === false) {
return false;
}
versionDelivered = versionDelivered.toString();
targetPath = targetPath.replace(versionNumber, versionDelivered);
versionRequested = versionNumber === null ? 'latest' : versionNumber[0];

View File

@ -640,6 +640,7 @@ helpers.setLastVersion = function (type, version) {
} else if (version === null) {
return 'latest';
}
return false;
};
helpers.compareVersion = function (v1, v2) {