When using a config like this
[tool.smyth]
host = "0.0.0.0"
port = 8080
[tool.smyth.handlers.other_handler]
handler_path = "my_project.app.other_handler"
url_path = "/other/{path:path}"
timeout = 500
[tool.smyth.handlers.root_handler]
handler_path = "my_project.app.handler"
url_path = "/{path:path}"
timeout = 500
The other_handler handler receives the full path /other/{path:path} while I would like to have the option for it to be unaware of the /other part of the path.
So I suggest we add a strip_prefix option to the HandlerConfig which would let the event builder know to strip it from the rawPath and path:
|
"rawPath": request.url.path, |
|
"body": (await request.body()).decode("utf-8"), |
|
"isBase64Encoded": False, |
|
"headers": dict(request.headers), |
|
"queryStringParameters": dict(request.query_params), |
|
"requestContext": { |
|
"http": { |
|
"method": request.method, |
|
"path": request.url.path, |
When using a config like this
The
other_handlerhandler receives the full path/other/{path:path}while I would like to have the option for it to be unaware of the/otherpart of the path.So I suggest we add a
strip_prefixoption to the HandlerConfig which would let the event builder know to strip it from therawPathandpath:smyth/src/smyth/event.py
Lines 10 to 18 in 725c856