aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2024-05-22 17:58:19 +0200
committerjonmv <venstad@gmail.com>2024-05-22 17:58:19 +0200
commitef52d60b6570f74182c96d55bdb5da70974c72fa (patch)
tree3dc88b23dffcdf830ab8da1b9d3fa32fbbe32a97
parent0e305bbc4727ddd99aef1392ccbf20ae18480776 (diff)
Avoid trailing slashes in configserver clients
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java4
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/http/TesterClient.java2
2 files changed, 3 insertions, 3 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
index c2c42054109..8ffbeede37e 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
@@ -1192,7 +1192,7 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye
// logs for any host if they are authorized for the hosted-vespa tenant.
if (hostname.isPresent() && HOSTED_VESPA_TENANT.equals(applicationId.tenant())) {
int port = List.of(InfrastructureApplication.CONFIG_SERVER.id(), InfrastructureApplication.CONTROLLER.id()).contains(applicationId) ? 19071 : 8080;
- return HttpURL.create(Scheme.http, hostname.get(), port).withPath(HttpURL.Path.empty().append("logs"));
+ return HttpURL.create(Scheme.http, hostname.get(), port).withPath(HttpURL.Path.parse("logs"));
}
Application application = getApplication(applicationId);
@@ -1211,7 +1211,7 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye
.findFirst())
.orElseThrow(() -> new IllegalArgumentException("No container running on logserver host"));
int port = servicePort(logService);
- return HttpURL.create(Scheme.http, DomainName.of(logServerHostInfo.getHostname()), port, HttpURL.Path.empty().append("logs"));
+ return HttpURL.create(Scheme.http, DomainName.of(logServerHostInfo.getHostname()), port, HttpURL.Path.parse("logs"));
}
private int servicePort(ServiceInfo serviceInfo) {
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/http/TesterClient.java b/configserver/src/main/java/com/yahoo/vespa/config/server/http/TesterClient.java
index a18f96e83bb..e25b0a13f42 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/http/TesterClient.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/http/TesterClient.java
@@ -72,7 +72,7 @@ public class TesterClient {
}
private HttpURL testerUrl(String testerHostname, int port, String... path) {
- return HttpURL.create(Scheme.https, DomainName.of(testerHostname), port, Path.empty().append(List.of(path)));
+ return HttpURL.create(Scheme.https, DomainName.of(testerHostname), port, Path.empty().append(List.of(path)).withoutTrailingSlash());
}
}