Skip to content

Commit

Permalink
Auth metadata endpoint is always rooted. (#404)
Browse files Browse the repository at this point in the history
* Auth metadata endpoint is always rooted.

* Ignore failing test.

* Use UriUtils instead of UriBuilder.
  • Loading branch information
alonadam authored Dec 23, 2024
1 parent 0da77fc commit 0acc991
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ private static CloudInfo fetchImpl(String clusterUrl, @Nullable HttpClient given
CloudInfo result;
HttpClient localHttpClient = givenHttpClient == null ? HttpClientFactory.create(null) : givenHttpClient;
try {
HttpRequest request = new HttpRequest(HttpMethod.GET, UriUtils.appendPathToUri(clusterUrl, METADATA_ENDPOINT));
// Metadata endpoint is always on the root of the cluster
HttpRequest request = new HttpRequest(HttpMethod.GET, UriUtils.setPathForUri(clusterUrl, METADATA_ENDPOINT));
request.setHeader(HttpHeaderName.ACCEPT_ENCODING, "gzip,deflate");
request.setHeader(HttpHeaderName.ACCEPT, "application/json");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ void testSameHttpClientInstance() throws DataClientException, DataServiceExcepti

}

@Disabled("This test is disabled because it relies on the path part of the cluster Uri which we now ignore")
@Test
void testNoRedirectsCloudFail() {
KustoTrustedEndpoints.addTrustedHosts(Collections.singletonList(new MatchRule("statusreturner.azurewebsites.net", false)), false);
Expand Down

0 comments on commit 0acc991

Please sign in to comment.