Switch to unified view

a/Allura/allura/config/middleware.py b/Allura/allura/config/middleware.py
...
...
159
    app = MingMiddleware(app)
159
    app = MingMiddleware(app)
160
    # Set up the registry for stacked object proxies (SOPs).
160
    # Set up the registry for stacked object proxies (SOPs).
161
    #    streaming=true ensures they won't be cleaned up till
161
    #    streaming=true ensures they won't be cleaned up till
162
    #    the WSGI application's iterator is exhausted
162
    #    the WSGI application's iterator is exhausted
163
    app = RegistryManager(app, streaming=True)
163
    app = RegistryManager(app, streaming=True)
164
    # Make sure that the wsgi.scheme is set appropriately when we
165
    # have the funky HTTP_X_SFINC_SSL  environ var
166
    if asbool(app_conf.get('auth.method', 'local')=='sfx'):
167
        app = set_scheme_middleware(app)
168
    # "task" wsgi would get a 2nd request to /error/document if we used this middleware
164
    # "task" wsgi would get a 2nd request to /error/document if we used this middleware
169
    if config.get('override_root') != 'task':
165
    if config.get('override_root') != 'task':
170
        # Converts exceptions to HTTP errors, shows traceback in debug mode
166
        # Converts exceptions to HTTP errors, shows traceback in debug mode
171
        tg.error.footer_html = '<!-- %s %s -->'  # don't use TG footer with extra CSS & images that take time to load
167
        tg.error.footer_html = '<!-- %s %s -->'  # don't use TG footer with extra CSS & images that take time to load
172
        app = tg.error.ErrorHandler(app, global_conf, **config['pylons.errorware'])
168
        app = tg.error.ErrorHandler(app, global_conf, **config['pylons.errorware'])
169
170
        # Make sure that the wsgi.scheme is set appropriately when we
171
        # have the funky HTTP_X_SFINC_SSL  environ var
172
        if asbool(app_conf.get('auth.method', 'local')=='sfx'):
173
            app = set_scheme_middleware(app)
174
        
173
        # Redirect some status codes to /error/document
175
        # Redirect some status codes to /error/document
174
        if asbool(config['debug']):
176
        if asbool(config['debug']):
175
            app = StatusCodeRedirect(app, base_config.handle_status_codes)
177
            app = StatusCodeRedirect(app, base_config.handle_status_codes)
176
        else:
178
        else:
177
            app = StatusCodeRedirect(app, base_config.handle_status_codes + [500])
179
            app = StatusCodeRedirect(app, base_config.handle_status_codes + [500])