diff --git a/rhodecode/tweens.py b/rhodecode/tweens.py --- a/rhodecode/tweens.py +++ b/rhodecode/tweens.py @@ -20,6 +20,8 @@ import logging + +import pyramid.tweens from pyramid.httpexceptions import HTTPException, HTTPBadRequest from rhodecode.lib.middleware.vcs import ( @@ -37,6 +39,7 @@ def vcs_detection_tween_factory(handler, this information """ vcs_server_enabled = request.registry.settings.get('vcs.server.enable') + vcs_handler = vcs_server_enabled and detect_vcs_request( request.environ, request.registry.settings.get('vcs.backends')) @@ -120,5 +123,5 @@ def includeme(config): config.add_tween('rhodecode.tweens.sanity_check_factory') # This needs to be the LAST item - config.add_tween('rhodecode.lib.middleware.request_wrapper.RequestWrapperTween') + config.add_tween('rhodecode.lib.middleware.request_wrapper.RequestWrapperTween', under=pyramid.tweens.INGRESS) log.debug('configured all tweens')