Add strip preffix feature
Opened this issue · 0 comments
pkucmus commented
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
:
Lines 10 to 18 in 725c856