From bd26e899640d65df9133906acb0edef2e881fc43 Mon Sep 17 00:00:00 2001 From: Christian Zuellig Date: Fri, 21 May 2021 07:37:00 +0200 Subject: [PATCH] respect that http header keys are most of the times not case sensitiv for compare with existing --- src/sdk/PnP.Core/Services/Core/BatchClient.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sdk/PnP.Core/Services/Core/BatchClient.cs b/src/sdk/PnP.Core/Services/Core/BatchClient.cs index ebf80fefcb..77604a2ef7 100644 --- a/src/sdk/PnP.Core/Services/Core/BatchClient.cs +++ b/src/sdk/PnP.Core/Services/Core/BatchClient.cs @@ -775,13 +775,14 @@ private Tuple 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]; } } }