--- api.py 2006-06-01 22:01:26.000000000 +0000 +++ api.py.orig 2006-06-01 21:59:10.000000000 +0000 @@ -458,10 +458,3 @@ Note that if template processing should not occur, this method can simply send the response itself and not return anything. """ - -class IFallbackHandler(Interface): - """Extension point interface for fallback handlers.""" - - def process_request(req): - """Process the request. The handler should not return, either by raising - an exception, or by redirecting the request elsewhere.""" --- main.py 2006-06-01 22:24:29.000000000 +0000 +++ main.py.orig 2006-06-01 21:46:02.000000000 +0000 @@ -116,29 +116,8 @@ elif isinstance(req.args[arg], basestring): hdf['args.%s' % arg] = req.args[arg] # others are file uploads - -class FallbackModule(Component): - """The default fallback policy.""" - - implements(IFallbackHandler) - def process_request(self, req): - raise HTTPNotFound('No handler matched request to %s', req.path_info) - -class WikiFallbackModule(Component): - """A fallback policy that redirects to a wiki page if one exists.""" - - implements(IFallbackHandler) - - def process_request(self, req): - from trac.wiki.model import WikiPage - name = req.path_info.lstrip('/') - page = WikiPage(self.env, name) - if page.exists: - req.redirect(req.href.wiki(name)) - else: - raise HTTPNotFound('No handler matched request to %s', req.path_info) - + class RequestDispatcher(Component): """Component responsible for dispatching requests to registered handlers.""" @@ -151,10 +130,6 @@ Options include `TimeLineModule`, `RoadmapModule`, `BrowserModule`, `QueryModule`, `ReportModule` and `NewticketModule` (''since 0.9'').""") - - fallback_handler = ExtensionOption('trac', 'fallback_handler', - IFallbackHandler, 'FallbackModule', - """Name of the component that handles requests to non-existant handlers.""") # Public API @@ -188,8 +163,8 @@ break if not chosen_handler: - #raise HTTPNotFound('No handler matched request to %s', req.path_info) - self.fallback_handler.process_request(req) + raise HTTPNotFound('No handler matched request to %s', + req.path_info) # Attach user information to the request anonymous_request = getattr(chosen_handler, 'anonymous_request', False)