aboutsummaryrefslogtreecommitdiffstats
path: root/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2020-01-20 13:27:05 +0100
committerJon Marius Venstad <venstad@gmail.com>2020-01-20 13:27:05 +0100
commit8d783f365d820141bdb01aeecb6cdab899d044a9 (patch)
tree124deb4b60b97ecbd43b52c580072f236bbd092d /controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java
parentbce0531c3f7679a4176a892608a9f77b31f9848d (diff)
Require scheme and host as well
Diffstat (limited to 'controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java
index 685eed22699..816d647dfbb 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java
@@ -51,7 +51,10 @@ public class ApplicationVersion implements Comparable<ApplicationVersion> {
if (commit.isPresent() && commit.get().length() > 128)
throw new IllegalArgumentException("Commit may not be longer than 128 characters");
- sourceUrl.map(URI::create);
+ sourceUrl.map(URI::create).ifPresent(url -> {
+ if (url.getHost() == null || url.getScheme() == null)
+ throw new IllegalArgumentException("Source URL must include scheme and host");
+ });
if (authorEmail.isPresent() && ! authorEmail.get().matches("[^@]+@[^@]+"))
throw new IllegalArgumentException("Invalid author email '" + authorEmail.get() + "'.");