diff --git a/.autover/changes/9f639a1b-3cd4-41ec-9d56-d6e95cb32b14.json b/.autover/changes/9f639a1b-3cd4-41ec-9d56-d6e95cb32b14.json new file mode 100644 index 000000000..5e6b008a8 --- /dev/null +++ b/.autover/changes/9f639a1b-3cd4-41ec-9d56-d6e95cb32b14.json @@ -0,0 +1,11 @@ +{ + "Projects": [ + { + "Name": "Amazon.Lambda.RuntimeSupport", + "Type": "Patch", + "ChangelogMessages": [ + "Fix issue making HTTP header comparisons be case insensitive" + ] + } + ] +} \ No newline at end of file diff --git a/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/RuntimeApiHeaders.cs b/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/RuntimeApiHeaders.cs index 4609a93bf..16c12f375 100644 --- a/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/RuntimeApiHeaders.cs +++ b/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/RuntimeApiHeaders.cs @@ -12,6 +12,7 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ +using System; using System.Collections.Generic; using System.Linq; @@ -45,12 +46,14 @@ public RuntimeApiHeaders(Dictionary> headers) private string GetHeaderValueRequired(Dictionary> headers, string header) { - return headers[header].FirstOrDefault(); + var headerKey = headers.Keys.FirstOrDefault(k => string.Equals(k, header, StringComparison.OrdinalIgnoreCase)); + return headers[headerKey].FirstOrDefault(); } private string GetHeaderValueOrNull(Dictionary> headers, string header) { - if (headers.TryGetValue(header, out var values)) + var headerKey = headers.Keys.FirstOrDefault(k => string.Equals(k, header, StringComparison.OrdinalIgnoreCase)); + if (headers.TryGetValue(headerKey, out var values)) { return values.FirstOrDefault(); } @@ -58,5 +61,4 @@ private string GetHeaderValueOrNull(Dictionary> head return null; } } - }