Polly context setter and getter use obsolete property from HttpRequestMessage
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
The extension methods to set and get Polly context of HttpRequestMessage for execution retry policy, both methods [GetPolicyExecutionContext](https://github.com/dotnet/aspnetcore/blob/main/src/HttpClientFactory/Polly/src/HttpRequestMessageExtensions.cs#L36) and [SetPolicyExecutionContext](https://github.com/dotnet/aspnetcore/blob/main/src/HttpClientFactory/Polly/src/HttpRequestMessageExtensions.cs#L57) are storing the context in [HttpRequestMessage.Properties](https://github.com/dotnet/runtime/blob/1d1bf92fcf43aa6981804dc53c5174445069c9e4/src/libraries/System.Net.Http/src/System/Net/Http/HttpRequestMessage.cs#L111C75-L111C90) which is obsolete.
This should be changed to use [Options](https://github.com/dotnet/runtime/blob/1d1bf92fcf43aa6981804dc53c5174445069c9e4/src/libraries/System.Net.Http/src/System/Net/Http/HttpRequestMessage.cs#L111C75-L111C90) instead.
Contributor guide
Assessment
This issue has not been assessed yet.