Skip to content

Commit

Permalink
Merge pull request #789 from Particular/fix-endpoint-retreival
Browse files Browse the repository at this point in the history
avoid exception thrown when endpoint URL is relative
  • Loading branch information
adamralph authored Feb 22, 2018
2 parents 0d0a7d9 + 9fbfd00 commit 8c88a94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ServiceInsight/ServiceControl/DefaultServiceControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ public async Task<IEnumerable<Endpoint>> GetEndpoints()
var rootUrls = await GetRootUrls().ConfigureAwait(false);

var endpointsUrl = rootUrls?.KnownEndpointsUrl ?? rootUrls?.EndpointsUrl ?? DefaultEndpointsEndpoint;
if (Uri.TryCreate(endpointsUrl, UriKind.RelativeOrAbsolute, out var endpointsUri) &&
Uri.TryCreate(connection.Url, UriKind.RelativeOrAbsolute, out var connectionUri))
if (Uri.TryCreate(endpointsUrl, UriKind.Absolute, out var endpointsUri) &&
Uri.TryCreate(connection.Url, UriKind.Absolute, out var connectionUri))
{
endpointsUrl = endpointsUri.PathAndQuery.Replace(connectionUri.PathAndQuery, string.Empty);
}
Expand Down

0 comments on commit 8c88a94

Please sign in to comment.