# HG changeset patch # User Marcin Kuzminski # Date 2017-01-13 16:46:54 # Node ID 0f43430bbfe0b1c9bb1c61dea28d940ccc0a7b65 # Parent ed9a1494a98ada0ceb6777469a896f078b126d78 http-app: added default not_found view. diff --git a/vcsserver/http_main.py b/vcsserver/http_main.py --- a/vcsserver/http_main.py +++ b/vcsserver/http_main.py @@ -203,6 +203,11 @@ class HTTPApplication(object): self.config.add_view(self.hg_stream(), route_name='stream_hg') self.config.add_view(self.git_stream(), route_name='stream_git') + + def notfound(request): + return {'status': '404 NOT FOUND'} + self.config.add_notfound_view(notfound, renderer='json') + self.config.add_view( self.handle_vcs_exception, context=Exception, custom_predicates=[self.is_vcs_exception])