mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 8803: Allow to add an ISO with URL that doesn't end with ".iso". The check checks that the url path should end with an iso
status 8803: resolved fixed
This commit is contained in:
parent
f55e83f607
commit
8cbdfe07c9
@ -224,9 +224,15 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe
|
||||
if (!isAdmin && zoneId == null) {
|
||||
throw new InvalidParameterValueException("Please specify a valid zone Id.");
|
||||
}
|
||||
|
||||
String urlPath = "";
|
||||
try {
|
||||
urlPath = (new URI(url)).getPath();
|
||||
} catch (URISyntaxException e) {
|
||||
throw new IllegalArgumentException("Invalid URL " + url);
|
||||
}
|
||||
if((!url.toLowerCase().endsWith("iso"))&&(!url.toLowerCase().endsWith("iso.zip"))&&(!url.toLowerCase().endsWith("iso.bz2"))
|
||||
&&(!url.toLowerCase().endsWith("iso.gz"))){
|
||||
&&(!url.toLowerCase().endsWith("iso.gz"))
|
||||
&&(!(urlPath.endsWith("iso")))){
|
||||
throw new InvalidParameterValueException("Please specify a valid iso");
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user