From ef52d60b6570f74182c96d55bdb5da70974c72fa Mon Sep 17 00:00:00 2001 From: jonmv Date: Wed, 22 May 2024 17:58:19 +0200 Subject: Avoid trailing slashes in configserver clients --- .../java/com/yahoo/vespa/config/server/ApplicationRepository.java | 4 ++-- .../main/java/com/yahoo/vespa/config/server/http/TesterClient.java | 2 +- 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()); } } -- cgit v1.2.3