-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS_LAMBDA_HTTP_IGNORE_STAGE_IN_PATH
does not ignore stage in API Gateway V2 (HTTP)
#919
Comments
It seems this is where the env_variable is handled: aws-lambda-rust-runtime/lambda-http/src/request.rs Lines 367 to 385 in 6228204
|
I think there is a misconception on what this variable is for. If the variable is not set, and your lambda event has a stage in the JSON payload, the runtime will add the stage to the path, so the function code receives the full path that APIGW received, in your case If the variable is set, the runtime will not add the stage to the path. However, if your path includes the stage directly, like I hope that makes sense. |
Thank you.
Yes, I've also tried to apply an env variable with Terraform — it behaved the same.
Yes, I understand. I don't expect it to remove the stage from the specified route. I've used both prefixed and unprefixed routes for demonstration purposes. In my example, the I would expect that the configuration: std::env::set_var("AWS_LAMBDA_HTTP_IGNORE_STAGE_IN_PATH", "true");
let app = Router::new()
.route("/route1", get(handler_sample))
.route("/route2", get(handler_sample)); could handle any stage in the API Gateway ( |
I am seeing the same behavior as @artemudovyk for API Gateway V2. Don't mean to create a +1 comment, but just wanted to see if this was going to be addressed of if there is anything we can do to help. |
The
AWS_LAMBDA_HTTP_IGNORE_STAGE_IN_PATH
env variable doesn't seem to work on API Gateway V2 (HTTP).Example:
Cargo.toml:
I will attach my Terraform code as well:
Build with:
And then apply Terraform.
When calling a
/v1/staged
route, response is returned:But not for
/v1/not-staged
- response is 404:Am I doing something wrong?
Can someone please suggest how to debug this issue?
The text was updated successfully, but these errors were encountered: