Skip to content

Commit

Permalink
Merge pull request #31278 from vespa-engine/jonmv/avoid-trailing-slashes
Browse files Browse the repository at this point in the history
Avoid trailing slashes in configserver clients
  • Loading branch information
jonmv authored May 22, 2024
2 parents f66470f + ef52d60 commit 35d47be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ private HttpURL getLogServerURI(ApplicationId applicationId, Optional<DomainName
// 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);
Expand All @@ -1211,7 +1211,7 @@ private HttpURL getLogServerURI(ApplicationId applicationId, Optional<DomainName
.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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private HttpResponse execute(HttpUriRequest request, String messageIfRequestFail
}

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());
}

}

0 comments on commit 35d47be

Please sign in to comment.