We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi
It fails to map a path correctly if an API is deployed to non root base path (eg /api) of API Gateway custom domain. serverless-wsgi handles it with an environment variable named API_GATEWAY_BASE_PATH - https://github.com/logandk/serverless-wsgi#custom-domain-names. (source - https://github.com/logandk/serverless-wsgi/blob/master/serverless_wsgi.py#L112).
It'll be helpful if the class is updated something similar shown below.
@dataclass class Mangum: app: ASGIApp enable_lifespan: bool = True api_gateway_base_path: str = None log_level: str = "info" ... def strip_base_path(self, event: dict): path_info = event["path"] if self.api_gateway_base_path: script_name = "/" + self.api_gateway_base_path if path_info.startswith(script_name): path_info = path_info[len(script_name) :] return urllib.parse.unquote(path_info or "/") .... def handle_http(self, event: dict, context: dict) -> dict: ... scope = { ... "path": self.strip_base_path(event), ... } ...
Thanks.
The text was updated successfully, but these errors were encountered:
@jaehyeon-kim thanks for raising this. Would you like to put in PR with your proposed changed? Otherwise I can take a look later.
Sorry, something went wrong.
Hi @ERM
Please find this PR - #79.
Cheers, Jaehyeon
Resolved by #79
No branches or pull requests
Hi
It fails to map a path correctly if an API is deployed to non root base path (eg /api) of API Gateway custom domain. serverless-wsgi handles it with an environment variable named API_GATEWAY_BASE_PATH - https://github.com/logandk/serverless-wsgi#custom-domain-names. (source - https://github.com/logandk/serverless-wsgi/blob/master/serverless_wsgi.py#L112).
It'll be helpful if the class is updated something similar shown below.
Thanks.
The text was updated successfully, but these errors were encountered: