-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
api_gateway_base_path not supported for ALB? #238
Comments
I'm not sure if it is intentional or not. API Gateway was originally the only supported event source and ALB support came long after the Should we replace |
Thanks for your reply. |
Summary
api_gateway_base_path
argument to strip the prefix of the http path before passing to the underlying appapi_gateway_base_path
works as expected for API Gateway eventsapi_gateway_base_path
does not work for ALB events.I looked at https://mangum.io/http/ and the GitHub issues and couldn't find this mentioned anywhere.
My Setup
Simplified version of my lambda handler:
An external API Gateway v2 HTTP has a route
/prefix/public/{proxy+}
integrated with the lambda.An internal ALB has a listener rule
/prefix/private/*
integrated with the lambda.Requests to
<api gateway url>/prefix/public/foo
arrive in the lambda andpublic_foo_function
is called, as expected.From within my VPC, internal requests to
<alb url>/prefix/private/bar
arrive in the lambda and Starlette returnsNot Found
404. This is unexpected.As a workaround, if I change the private route in Starlette app from
/private/bar
to/prefix/private/bar
,private_bar_function
is called.Considerations
api_gateway_base_path
does have 'api gateway' in the name, and ALB is not an API Gateway. So there's an argument it could be intentional?But, I expected mangum to behave consistently for all of its supported input events.
The text was updated successfully, but these errors were encountered: