-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
Description
@app.route(
r"/test/<regex(user(\d+)?):user>/<sport>" )
def test(user, sport):
return ("OK", "text/plain", "YO")this will fail here
lambda-proxy/lambda_proxy/proxy.py
Lines 401 to 413 in ac5ad11
| def _get_matching_args(self, route: RouteEntry, url: str) -> Dict: | |
| route_expr = re.compile(route.route_regex) | |
| route_args = [i.group() for i in params_expr.finditer(route.path)] | |
| url_args = route_expr.match(url).groups() | |
| names = [param_pattern.match(arg).groupdict()["name"] for arg in route_args] | |
| args = [ | |
| _converters(u, route_args[id]) | |
| for id, u in enumerate(url_args) | |
| if u != route_args[id] | |
| ] | |
because url_args = route_expr.match(url).groups() will return ('user1234', '1234', 'rugby')
fix
Use patterns ?
Reactions are currently unavailable