mirror of
https://github.com/imgfloat/server.git
synced 2026-02-05 03:39:26 +00:00
Fail on missing version
This commit is contained in:
@@ -69,16 +69,12 @@ public class VersionService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String normalizeReleaseVersion(String baseVersion) {
|
private String normalizeReleaseVersion(String baseVersion) throws IllegalStateException {
|
||||||
if (baseVersion == null || baseVersion.isBlank()) {
|
|
||||||
return "latest";
|
|
||||||
}
|
|
||||||
|
|
||||||
String normalized = baseVersion.trim();
|
String normalized = baseVersion.trim();
|
||||||
normalized = normalized.replaceFirst("(?i)^v", "");
|
normalized = normalized.replaceFirst("(?i)^v", "");
|
||||||
normalized = normalized.replaceFirst("-SNAPSHOT$", "");
|
normalized = normalized.replaceFirst("-SNAPSHOT$", "");
|
||||||
if (normalized.isBlank()) {
|
if (normalized.isBlank()) {
|
||||||
return "latest";
|
throw new IllegalStateException("Invalid version: " + baseVersion);
|
||||||
}
|
}
|
||||||
return normalized;
|
return normalized;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user