summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2024-05-22 18:02:01 +0200
committerGitHub <noreply@github.com>2024-05-22 18:02:01 +0200
commit35d47beb9b8a98c8545ac2b740c086de83961a3b (patch)
tree5c5f07e7e9092fb932713809f06764b7fdd8c295
parentf66470fbf2400aecdc7487376d1bd97440b8a3be (diff)
parentef52d60b6570f74182c96d55bdb5da70974c72fa (diff)
Merge pull request #31278 from vespa-engine/jonmv/avoid-trailing-slashesv8.346.21
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());
}
}