Skip to content

Commit

Permalink
fix for 46109 (#46401)
Browse files Browse the repository at this point in the history
  • Loading branch information
annelo-msft authored Oct 2, 2024
1 parent 3a55d32 commit 2d93e3d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public override void Process(PipelineMessage message, IReadOnlyList<PipelinePoli
TokenRequestContext tokenRequestContext = CreateRequestContext(message.Request);
_currentToken = _credential.GetToken(tokenRequestContext, cancellationToken: default);
}
message?.Request?.Headers?.Add("Authorization", $"Bearer {_currentToken.Value.Token}");
message?.Request?.Headers?.Set("Authorization", $"Bearer {_currentToken.Value.Token}");
}
ProcessNext(message, pipeline, currentIndex);
if (message?.Response?.Status == (int)HttpStatusCode.Unauthorized)
Expand All @@ -53,7 +53,7 @@ public override async ValueTask ProcessAsync(PipelineMessage message, IReadOnlyL
_currentToken
= await _credential.GetTokenAsync(tokenRequestContext, cancellationToken: default).ConfigureAwait(false);
}
message?.Request?.Headers?.Add("Authorization", $"Bearer {_currentToken.Value.Token}");
message?.Request?.Headers?.Set("Authorization", $"Bearer {_currentToken.Value.Token}");
}
await ProcessNextAsync(message, pipeline, currentIndex).ConfigureAwait(false);
if (message?.Response?.Status == (int)HttpStatusCode.Unauthorized)
Expand Down

0 comments on commit 2d93e3d

Please sign in to comment.