You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!Regex("^[0-9]+\\.[0-9]+\\.[0-9]+\$").matches(indexJson.indexVersion)) throwIllegalArgumentException("Invalid index version: ${indexJson.indexVersion}")
19
19
indexJson.identifiers.forEach {
20
-
if (!Regex("^[a-z0-9\\-_]+:[a-z0-9\\-_]+:[a-z0-9\\-_]+\$").matches(it)) throwIllegalArgumentException("Invalid identifier: $it")
20
+
if (!Regex("^[a-z0-9\\-_]+:[a-z0-9\\-_]+:[a-z0-9]{15}\$").matches(it)) throwIllegalArgumentException("Invalid identifier: $it")
21
21
}
22
22
}
23
23
@@ -40,7 +40,7 @@ private fun validateManifestRegex(manifestJson: ManifestJson) {
40
40
versionFile.mcVersions.forEach {
41
41
if (!Regex("^[0-9]+\\.[0-9]+\\.[0-9]+[a-zA-Z0-9\\-+._\\s]*\$").matches(it)) throwIllegalArgumentException("Invalid MC version: $it in ${manifestJson.genericIdentifier}")
42
42
}
43
-
if (!Regex("^[a-z0-9]{128}\$").matches(versionFile.sha512Hash)) throwIllegalArgumentException("Invalid SHA512 hash: ${versionFile.sha512Hash} in ${manifestJson.genericIdentifier}")
43
+
if (!Regex("^[a-z0-9]{15}\$").matches(versionFile.shortSha512Hash)) throwIllegalArgumentException("Invalid SHA512 hash: ${versionFile.shortSha512Hash} in ${manifestJson.genericIdentifier}")
44
44
versionFile.downloadUrls.forEach {
45
45
if (!Regex("^[a-zA-Z0-9\\-_:/?&]+\$").matches(it)) throwIllegalArgumentException("Invalid download url: $it in ${manifestJson.genericIdentifier}")
0 commit comments