Header is not updated on retry policy [RestEase+Polly combination] #192
Replies: 3 comments 5 replies
-
Presumably Polly is re-sending the At the very least, you need to update the X-Token header in your |
Beta Was this translation helpful? Give feedback.
-
(Converting to a discussion, per the issue template, as this isn't a bug) |
Beta Was this translation helpful? Give feedback.
-
I had this same issue recently, I got around it by implementing my Polly policies inside the SendAsync of a custom HttpClientHandler. If you only have a single retry policy for your auth then you can just set the request header: I guess the same would apply for a custom HttpMessageHandler |
Beta Was this translation helpful? Give feedback.
-
Hi!
Really need some help to understand what am I doing wrong with my RestEase+Polly combination for reauthorization.
My policy looks like this:
And IRestEaseClient looks like this:
When the token expires the breakpoint inside the policy retry function is hit, I successfully receive the new token, set its value to IRestEaseClient.Token header, but for some reason, the retry request goes with the old header value and I still get 401. The next request after this will go fine, without 401 and hitting the reauthorize policy code.
Beta Was this translation helpful? Give feedback.
All reactions