The headers are available in the Http Request when it's sent from the AWS API gateway and received by the FunctionInvoker. It looks like the code specifically ignores them if it matches:
Message requestMessage = isApiGateway
? MessageBuilder.withPayload(payload).setHeader(AWSLambdaUtils.AWS_API_GATEWAY, true).build()
But, if it falls into the AWSLambdaUtils, it looks like it copies in the provided headers.
Object providedHeaders = ((Map) request).remove("headers");
if (providedHeaders != null && providedHeaders instanceof Map) {
messageBuilder.removeHeader("headers");
messageBuilder.copyHeaders((Map<String, Object>) providedHeaders);
}
How does one get the headers from FunctionInvoker or from the AWS adapter without using deprecated classes?
Is it intentional to not provide functions access to request headers?