Rack middleware is not called when using scope with interpolation
ahx opened this issue · comments
Andreas Haller commented
Scenario
There seems to be a problem when adding a middleware inside a scope
block with interpolation.
Here is an example:
scope 'i' do
scope ':tenant_id' do
use LogTenantIdMiddleware
get 'foo' do
"Hello, world #{params[:tenant_id]}"
end
end
end
Problem
GET "/i/42/foo"
LogTenantIdMiddleware
is not called- Responds with status 200, "Hello, world 42"
GET "/i/:tenant_id/foo"
LogTenantIdMiddleware
is called- Responds with status 200, "Hello, world :tenant_id"
Example
Here is a gist with a demo app to illustrate the issue.
Chris Wawer commented
founded fix in hanami-router, I will prepare PR and past link to PR here