Describe the bug
RIC expects to get case sensitive (capitalized kebab case) headers from the Lambda Runtime API.
|
internal const string HeaderAwsRequestId = "Lambda-Runtime-Aws-Request-Id"; |
|
internal const string HeaderTraceId = "Lambda-Runtime-Trace-Id"; |
|
internal const string HeaderClientContext = "Lambda-Runtime-Client-Context"; |
|
internal const string HeaderCognitoIdentity = "Lambda-Runtime-Cognito-Identity"; |
|
internal const string HeaderDeadlineMs = "Lambda-Runtime-Deadline-Ms"; |
|
internal const string HeaderInvokedFunctionArn = "Lambda-Runtime-Invoked-Function-Arn"; |
|
|
Regression Issue
Expected Behavior
This should be case insensitive.
It works perfectly for NodeJS
https://github.com/aws/aws-lambda-nodejs-runtime-interface-client/blob/a5ae1c2a92708e81c9df4949c60fd9e1e6e46bed/src/InvokeContext.js#L14-L22
-- edit:
Also works perfectly for Java, Python, and Ruby
Current Behavior
When building a rust Proxy Server for the Lambda Runtime API, I get the following error when working in .NET functions.
Unhandled exception. System.Collections.Generic.KeyNotFoundException: The given key 'Lambda-Runtime-Aws-Request-Id' was not present in the dictionary.
--
| 2025-06-17T19:10:32.131Z | at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
| 2025-06-17T19:10:32.131Z | at Amazon.Lambda.RuntimeSupport.RuntimeApiHeaders..ctor(Dictionary`2 headers) in /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/RuntimeApiHeaders.cs:line 32
| 2025-06-17T19:10:32.131Z | at Amazon.Lambda.RuntimeSupport.RuntimeApiClient.GetNextInvocationAsync(CancellationToken cancellationToken) in /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/RuntimeApiClient.cs:line 112
| 2025-06-17T19:10:32.131Z | at Amazon.Lambda.RuntimeSupport.LambdaBootstrap.InvokeOnceAsync(CancellationToken cancellationToken) in /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/LambdaBootstrap.cs:line 261
| 2025-06-17T19:10:32.131Z | at Amazon.Lambda.RuntimeSupport.LambdaBootstrap.RunAsync(CancellationToken cancellationToken) in /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/LambdaBootstrap.cs:line 224
| 2025-06-17T19:10:32.131Z | at Amazon.Lambda.RuntimeSupport.RuntimeSupportInitializer.RunLambdaBootstrap() in /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/RuntimeSupportInitializer.cs:line 70
| 2025-06-17T19:10:32.131Z | at Amazon.Lambda.RuntimeSupport.Program.Main(String[] args) in /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Program.cs:line 48
| 2025-06-17T19:10:32.131Z | at Amazon.Lambda.RuntimeSupport.Program.<Main>(String[] args)
Reproduction Steps
Build a Lambda Runtime API proxy in Rust, then just do a bypass and see how it fails for .NET
Possible Solution
Making header lookup case insensitive
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
n/a
Targeted .NET Platform
.NET 6 and .NET 8
Operating System and version
AWS Lambda
Describe the bug
RIC expects to get case sensitive (capitalized kebab case) headers from the Lambda Runtime API.
aws-lambda-dotnet/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/RuntimeApiHeaders.cs
Lines 22 to 28 in 3c68321
Regression Issue
Expected Behavior
This should be case insensitive.
It works perfectly for NodeJS
https://github.com/aws/aws-lambda-nodejs-runtime-interface-client/blob/a5ae1c2a92708e81c9df4949c60fd9e1e6e46bed/src/InvokeContext.js#L14-L22
-- edit:
Also works perfectly for Java, Python, and Ruby
Current Behavior
When building a rust Proxy Server for the Lambda Runtime API, I get the following error when working in .NET functions.
Reproduction Steps
Build a Lambda Runtime API proxy in Rust, then just do a bypass and see how it fails for .NET
Possible Solution
Making header lookup case insensitive
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
n/a
Targeted .NET Platform
.NET 6 and .NET 8
Operating System and version
AWS Lambda