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) {
|
||||
if (baseVersion == null || baseVersion.isBlank()) {
|
||||
return "latest";
|
||||
}
|
||||
|
||||
private String normalizeReleaseVersion(String baseVersion) throws IllegalStateException {
|
||||
String normalized = baseVersion.trim();
|
||||
normalized = normalized.replaceFirst("(?i)^v", "");
|
||||
normalized = normalized.replaceFirst("-SNAPSHOT$", "");
|
||||
if (normalized.isBlank()) {
|
||||
return "latest";
|
||||
throw new IllegalStateException("Invalid version: " + baseVersion);
|
||||
}
|
||||
return normalized;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user