Skip to content

Commit

Permalink
respect that http header keys are most of the times not case sensitiv…
Browse files Browse the repository at this point in the history
… for compare with existing
  • Loading branch information
Christian Zuellig committed May 21, 2021
1 parent f8a8d50 commit bd26e89
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sdk/PnP.Core/Services/Core/BatchClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -775,13 +775,14 @@ private Tuple<string, string> BuildMicrosoftGraphBatchRequestContent(Batch batch
{
foreach(var key in request.ApiCall.Headers.Keys)
{
if(!graphRequest.Headers.ContainsKey(key))
string existingKey = graphRequest.Headers.Keys.FirstOrDefault(k => k.Equals(key, StringComparison.InvariantCultureIgnoreCase));
if (string.IsNullOrWhiteSpace(existingKey))
{
graphRequest.Headers.Add(key, request.ApiCall.Headers[key]);
}
else
{
graphRequest.Headers[key] = request.ApiCall.Headers[key];
graphRequest.Headers[existingKey] = request.ApiCall.Headers[key];
}
}
}
Expand Down

0 comments on commit bd26e89

Please sign in to comment.