Skip to content
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

Request.url does not include the api_gateway_base_path #318

Open
beck3905 opened this issue Feb 20, 2024 · 0 comments
Open

Request.url does not include the api_gateway_base_path #318

beck3905 opened this issue Feb 20, 2024 · 0 comments

Comments

@beck3905
Copy link

I am using Mangum in a Lambda handler behind an API Gateway with a custom domain name. When I instantiate Mangum I provide my base path mapping with the api_gateway_base_path parameter. Inside my handler I reference the Request.url property, but it does not provide the actual URL used for the request because it does not include the API Gateway base path value in the path.

Reading the FastAPI docs it seems that this is what the root_path scope property is supposed to be used for, but in the APIGateway handler class root_path gets set to "".

https://github.com/jordaneremieff/mangum/blob/main/mangum/handlers/api_gateway.py#L101

Would it make sense for the root_path to be set to the api_gateway_base_path value if it is provided?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant