Closed jantb closed 6 months ago
This also broke us, it broke CORS Allow-Origin headers in our case.
Ugh. I'm very sorry about that. I've yanked that version from crates.io. It looks like this is not consistent in all the integrations: https://github.com/awslabs/aws-lambda-rust-runtime/pull/852. We'll investigate further.
@jantb how did you create your APIGW? I wonder if there are some settings that we're missing, and affect how headers are returned
@shortjared which service do you integrate with, APIGW? which kind? If you have any configuration that you can share, it'd be very helpful.
Here is the setup of the http APIGW:
val httpApi =
HttpApi(
this, "Api", HttpApiProps.builder()
.apiName("api")
.corsPreflight(
CorsPreflightOptions.builder().allowOrigins(
listOf(
"xxx",
"xxx",
"http://localhost:8080",
)
).allowMethods(CorsHttpMethod.entries)
.build()
)
.build()
)
and the functions are added with:
AddRoutesOptions.builder().path(path).methods(listOf(method))
.integration(
HttpLambdaIntegration(
"$functionName-integration",
function
)
).build()
Cloudformation:
{"Api": {
"Type": "AWS::ApiGatewayV2::Api",
"Properties": {
"CorsConfiguration": {
"AllowMethods": [
"*",
"DELETE",
"GET",
"HEAD",
"OPTIONS",
"PATCH",
"POST",
"PUT"
],
"AllowOrigins": [
"",
"",
"http://localhost:8080"
]
},
"Name": "api",
"ProtocolType": "HTTP"
},
"Metadata": {
"aws:cdk:path": "xxx/Api/Resource"
}
}
}
{
"ApiGETservehtmlintegration": {
"Type": "AWS::ApiGatewayV2::Integration",
"Properties": {
"ApiId": {
"Ref": "ApiF"
},
"IntegrationType": "AWS_PROXY",
"IntegrationUri": {
"Fn::GetAtt": [
"servehtml",
"Arn"
]
},
"PayloadFormatVersion": "2.0"
},
"Metadata": {
"aws:cdk:path": "xxxx/Api/GET--/serve-html-integration/Resource"
}
}}
Also reporting that lambda function URL regression (previously in #871) is still present in 0.11.3.
Lambda function URLs use API gateway v2 format:
The request and response event formats follow the same schema as the Amazon API Gateway payload format version 2.0.
https://docs.aws.amazon.com/lambda/latest/dg/urls-invocation.html#urls-payloads
Note that in #852, the author references a pull request from aws-lambda-go-api-proxy
repo from 2020. That was before the code base was refactored to split the types for API gateway v1/v2 & ALB integrations.
They currently handle header keys differently based on integration types there on master
.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one.
I'm getting no response headers when using the latest version of lambda http,
I am using this config in cargo.toml
lambda_http = { version = "=0.11.3",default-features = false, features = ["apigw_http"] }
0.11.1 does not have this issue:
Here is how I set the response in the handler
curl -v shows this as the headers with version 0.11.1
and for 0.11.3:
This seems related to this commit fc49dd5 which is the only one in 0.11.3