request-wrapper: ensure we wrap WHOLE request not just logic after http detection.

This commit is contained in:
Marcin Kuzminski 2019-12-26 19:52:17 +01:00
parent 869993afa8
commit 631a663b62
3 changed files with 5 additions and 3 deletions

View file

@ -428,9 +428,7 @@ def sanitize_settings_and_apply_defaults(global_config, settings):
settings['beaker.session.url'] = 'redis://' + raw_url
# Default includes, possible to change as a user
pyramid_includes = settings.setdefault('pyramid.includes', [
'rhodecode.lib.middleware.request_wrapper',
])
pyramid_includes = settings.setdefault('pyramid.includes', [])
log.debug(
"Using the following pyramid.includes: %s",
pyramid_includes)

View file

@ -38,6 +38,7 @@ class RequestWrapperTween(object):
def __call__(self, request):
start = time.time()
log.debug('Starting request time measurement')
try:
response = self.handler(request)
finally:

View file

@ -116,3 +116,6 @@ def includeme(config):
'pyramid.events.ContextFound')
config.add_tween('rhodecode.tweens.vcs_detection_tween_factory')
config.add_tween('rhodecode.tweens.sanity_check_factory')
# This needs to be the LAST item
config.add_tween('rhodecode.lib.middleware.request_wrapper.RequestWrapperTween')