You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2014/11/18 03:28:55 UTC

[2/2] allura git commit: [#7787] move "outer" middleware to be fully outside everything

[#7787] move "outer" middleware to be fully outside everything


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/385b9bf8
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/385b9bf8
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/385b9bf8

Branch: refs/heads/db/7787
Commit: 385b9bf8491ab02bc808e01171ad24d8223189a5
Parents: b81dfca
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Tue Nov 18 02:28:42 2014 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Tue Nov 18 02:28:42 2014 +0000

----------------------------------------------------------------------
 Allura/allura/config/middleware.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/385b9bf8/Allura/allura/config/middleware.py
----------------------------------------------------------------------
diff --git a/Allura/allura/config/middleware.py b/Allura/allura/config/middleware.py
index 1a7beb8..840a39c 100644
--- a/Allura/allura/config/middleware.py
+++ b/Allura/allura/config/middleware.py
@@ -169,11 +169,6 @@ def _make_core_app(root, global_conf, full_stack=True, **app_conf):
     #    the WSGI application's iterator is exhausted
     app = RegistryManager(app, streaming=True)
 
-    for mw_ep in h.iter_entry_points('allura.middleware'):
-        Middleware = mw_ep.load()
-        if getattr(Middleware, 'when', 'inner') == 'outer':
-            app = Middleware(app, config)
-
     # "task" wsgi would get a 2nd request to /error/document if we used this middleware
     if config.get('override_root') != 'task':
         # Converts exceptions to HTTP errors, shows traceback in debug mode
@@ -188,6 +183,12 @@ def _make_core_app(root, global_conf, full_stack=True, **app_conf):
         else:
             app = StatusCodeRedirect(
                 app, base_config.handle_status_codes + [500])
+
+    for mw_ep in h.iter_entry_points('allura.middleware'):
+        Middleware = mw_ep.load()
+        if getattr(Middleware, 'when', 'inner') == 'outer':
+            app = Middleware(app, config)
+
     return app