Skip to content
This repository has been archived by the owner on Feb 11, 2025. It is now read-only.

Revert "Get the URL authority when retrieving it from the HttpClient BaseAddress" #596

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Client/Extensions/HttpClientDiscoveryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static async Task<DiscoveryDocumentResponse> GetDiscoveryDocumentAsync(th
}
else if (client is HttpClient httpClient && httpClient.BaseAddress != null)
{
address = httpClient.BaseAddress!.GetLeftPart(UriPartial.Authority);
address = httpClient.BaseAddress!.AbsoluteUri;
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,12 @@ public async Task Http_request_should_have_correct_format()
}


[Theory]
[InlineData("https://demo.identityserver.io")]
[InlineData("https://demo.identityserver.io/api/v1/")]
[InlineData("https://demo.identityserver.io/.well-known/openid-configuration")]
public async Task Base_address_should_work(string baseAddress)
[Fact]
public async Task Base_address_should_work()
{
var client = new HttpClient(_successHandler)
{
BaseAddress = new Uri(baseAddress)
BaseAddress = new Uri(_endpoint)
};

var disco = await client.GetDiscoveryDocumentAsync();
Expand Down
Loading