lambda-proxy icon indicating copy to clipboard operation
lambda-proxy copied to clipboard

Can't use ()? in regex path definition

Open vincentsarago opened this issue 6 years ago • 0 comments

@app.route( 
    r"/test/<regex(user(\d+)?):user>/<sport>" ) 
def test(user, sport): 
    return ("OK", "text/plain", "YO")

this will fail here https://github.com/vincentsarago/lambda-proxy/blob/ac5ad110e16c5bba98739f07cc0ecdfae71e7b57/lambda_proxy/proxy.py#L401-L413

because url_args = route_expr.match(url).groups() will return ('user1234', '1234', 'rugby')

fix

Use patterns ?

vincentsarago avatar Oct 02 '19 14:10 vincentsarago