postrank-labs/goliath — Issue #127: routing logic with maps
Author: schmurfy
Created: 2012-01-05 16:48:45+00:00
State: open

I just found this piece of code while debugging a problem in my application, if I understand this correctly if routes are defined and the queried url does not match any map defined the engine with arbitrarly send the request to the latest defined map, is it correct ?

def router
unless @router
@router = HttpRouter.new
@router.default(proc{ |env|
@router.routes.last.dest.call(env)
})
end
@router
end

If the behavior is as I described above it looks really weird to me as a default.
If the query does not match anything I prefer to get an error instead of the engine doing some voodoo to try making things work :)