Hi,On Thu, Jul 25, 2013 at 3:02 AM, Tom Wardrop <t...@tomwardrop.com> wrote:Oh I think you know you mean. So if your Rack app was mapping in Scorched to `/sub`, and you went to the URL `/sub/new`, the Rack app would see `/sub/new` as the path instead of just `/new`. I wonder if this is something I should change?
I think the sane change would be to pass env without modification only to Scorched::Controller and mangle PATH_INFO for others:class Scorched::Controller...def actionresponse.merge! if target === Procinstance_exec(env, &target)elsif target.is_a? Scorched::Controllertarget.call(env)else# XXX: mangle PATH_INFO to include only request.unmatched_pathtarget.call(env)endend...endBTW. Why not to make a helper for mounting subcontrollers instead of self << ?
It's a tricky one. I'd prefer to treat Scorched::Controller like any other Rack-callable object, but then the environment hash is the only means of sharing request-state between other controllers in the pipeline, hence any dup'ing of the environment hash (for the sake of mangling PATH_INFO) would break that. Maybe special treatment does need to be made when passing a request from one Scorched::Controller to another Scorched::Controller, like you've proposed.