dotnet / dotnet/aspnetcore

Polly context setter and getter use obsolete property from HttpRequestMessage

Open
#59,833 0 comments 0 reactions 0 assignees View on GitHub
area-networking
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.