Skip to content
This repository was archived by the owner on Jul 9, 2024. It is now read-only.

Commit b80e07c

Browse files
authored
Merge pull request #108 from gridlocdev/main
Default RequestAdapter BaseUrl to client BaseAddress
2 parents bac2f71 + 865d864 commit b80e07c

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.0.3] - 2023-06-09
11+
12+
- Added propagating the HttpClientRequestAdapter's supplied HttpClient BaseAddress as the adapter's initial BaseUrl
13+
1014
### Added
1115

1216
## [1.0.2] - 2023-04-06

src/HttpClientRequestAdapter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public HttpClientRequestAdapter(IAuthenticationProvider authenticationProvider,
4747
authProvider = authenticationProvider ?? throw new ArgumentNullException(nameof(authenticationProvider));
4848
createdClient = httpClient == null;
4949
client = httpClient ?? KiotaClientFactory.Create();
50+
BaseUrl = client.BaseAddress?.ToString();
5051
pNodeFactory = parseNodeFactory ?? ParseNodeFactoryRegistry.DefaultInstance;
5152
sWriterFactory = serializationWriterFactory ?? SerializationWriterFactoryRegistry.DefaultInstance;
5253
obsOptions = observabilityOptions ?? new ObservabilityOptions();
@@ -374,7 +375,7 @@ private async Task ThrowIfFailedResponse(HttpResponseMessage response, Dictionar
374375
apiEx.ResponseStatusCode = statusCodeAsInt;
375376
apiEx.ResponseHeaders = responseHeadersDictionary;
376377
}
377-
378+
378379
throw ex;
379380
}
380381
private static IResponseHandler? GetResponseHandler(RequestInformation requestInfo)

src/Microsoft.Kiota.Http.HttpClientLibrary.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<PackageProjectUrl>https://microsoft.github.io/kiota/</PackageProjectUrl>
1414
<EmbedUntrackedSources>true</EmbedUntrackedSources>
1515
<Deterministic>true</Deterministic>
16-
<VersionPrefix>1.0.2</VersionPrefix>
16+
<VersionPrefix>1.0.3</VersionPrefix>
1717
<VersionSuffix></VersionSuffix>
1818
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1919
<!-- Enable this line once we go live to prevent breaking changes -->

0 commit comments

Comments
 (0)