AwsSpringHttpProcessingUtils in module aws-serverless-java-container-springboot3 has a NullPointerException
Starting at line 127:
if (v1Request.getMultiValueHeaders() != null) {
MultiValueMapAdapter headers = new MultiValueMapAdapter(v1Request.getMultiValueHeaders());
httpRequest.setHeaders(headers);
}
populateContentAndContentType(
v1Request.getBody(),
v1Request.getMultiValueHeaders().getFirst(HttpHeaders.CONTENT_TYPE),
v1Request.isBase64Encoded(),
httpRequest
);
If v1Request.getMultiValueHeaders() returns null, the lines the first if block is skipped. In the call to populateContentAndContentType, getMultiValueHeaders() is referenced, resulting in a NullPointerException
Running into this with one of our APIs. Attempting to test a gateway method via the console without providing headers results in the following request being sent to our lambda:
Endpoint request body after transformations: {
"resource":"[...]",
"path":"[...]",
"httpMethod":"GET",
"headers":null,
"multiValueHeaders":null,
"queryStringParameters":null,
"multiValueQueryStringParameters":null,
"pathParameters":null,
"stageVariables":null,
[...]
Notice how the values provided for headers and multiValueHeaders is null.
This issue is present in at least versions 2.1.4 and 2.1.3. I haven't had time to test other versions.
We are currently blocked by this, any chance of getting this fixed with the next release? Thanks in advance.
@Charentule that's exactly where I saw the problem as well. I need to add some more unit tests to make sure I don't foul things up, but as soon as I've done that and feel confident in the results, I will submit the PR for consideration by the admins. Thanks for letting me know that it wasn't just me having the issue. I was starting to question that.
@Charentule I have added more tests and resubmitted the PR for review and merging