diff --git a/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/ApiGatewayRequestTranslatorFactory.cs b/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/ApiGatewayRequestTranslatorFactory.cs index a2de81892..72d93034f 100644 --- a/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/ApiGatewayRequestTranslatorFactory.cs +++ b/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/ApiGatewayRequestTranslatorFactory.cs @@ -28,7 +28,8 @@ public IApiGatewayRequestTranslator Create(ApiGatewayMode apiGatewayMode) { ApiGatewayMode.REST => _serviceProvider.GetRequiredService(), ApiGatewayMode.HTTPV1 => _serviceProvider.GetRequiredService(), - ApiGatewayMode.HTTPV2 => _serviceProvider.GetRequiredService() + ApiGatewayMode.HTTPV2 => _serviceProvider.GetRequiredService(), + _ => throw new NotImplementedException() }; } } diff --git a/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/HttpRequestUtility.cs b/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/HttpRequestUtility.cs index 8afc38570..eb77a8b5e 100644 --- a/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/HttpRequestUtility.cs +++ b/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/HttpRequestUtility.cs @@ -56,8 +56,8 @@ public string ReadRequestBody(HttpRequest request) foreach (var header in headers) { - singleValueHeaders[header.Key] = header.Value.Last(); - multiValueHeaders[header.Key] = header.Value.ToList(); + singleValueHeaders[header.Key] = header.Value.Last() ?? ""; + multiValueHeaders[header.Key] = [.. header.Value]; } return (singleValueHeaders, multiValueHeaders); @@ -82,7 +82,7 @@ public string ReadRequestBody(HttpRequest request) foreach (var param in query) { - singleValueParams[param.Key] = param.Value.Last(); + singleValueParams[param.Key] = param.Value.Last() ?? ""; multiValueParams[param.Key] = [.. param.Value]; }