Skip to content

Commit 57bfdc2

Browse files
committed
Fix build warnings
1 parent 080a13d commit 57bfdc2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/ApiGatewayRequestTranslatorFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ public IApiGatewayRequestTranslator Create(ApiGatewayMode apiGatewayMode)
2828
{
2929
ApiGatewayMode.REST => _serviceProvider.GetRequiredService<ApiGatewayProxyRequestTranslator>(),
3030
ApiGatewayMode.HTTPV1 => _serviceProvider.GetRequiredService<ApiGatewayProxyRequestTranslator>(),
31-
ApiGatewayMode.HTTPV2 => _serviceProvider.GetRequiredService<ApiGatewayHttpApiV2ProxyRequestTranslator>()
31+
ApiGatewayMode.HTTPV2 => _serviceProvider.GetRequiredService<ApiGatewayHttpApiV2ProxyRequestTranslator>(),
32+
_ => throw new NotImplementedException()
3233
};
3334
}
3435
}

Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/HttpRequestUtility.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public string ReadRequestBody(HttpRequest request)
5656

5757
foreach (var header in headers)
5858
{
59-
singleValueHeaders[header.Key] = header.Value.Last();
60-
multiValueHeaders[header.Key] = header.Value.ToList();
59+
singleValueHeaders[header.Key] = header.Value.Last() ?? "";
60+
multiValueHeaders[header.Key] = [.. header.Value];
6161
}
6262

6363
return (singleValueHeaders, multiValueHeaders);
@@ -82,7 +82,7 @@ public string ReadRequestBody(HttpRequest request)
8282

8383
foreach (var param in query)
8484
{
85-
singleValueParams[param.Key] = param.Value.Last();
85+
singleValueParams[param.Key] = param.Value.Last() ?? "";
8686
multiValueParams[param.Key] = [.. param.Value];
8787
}
8888

0 commit comments

Comments
 (0)