incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#6093] better middleware response, so WebError works
Date Mon, 22 Apr 2013 19:44:31 GMT
Updated Branches:
  refs/heads/db/6093 [created] 3f47f5db9


[#6093] better middleware response, so WebError works


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

Branch: refs/heads/db/6093
Commit: 3f47f5db9a3245d78f7ef5a4448f5fcd4292c23f
Parents: 1958598
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Mon Apr 22 19:44:23 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Apr 22 19:44:23 2013 +0000

----------------------------------------------------------------------
 Allura/allura/config/middleware.py     |    1 +
 Allura/allura/lib/custom_middleware.py |    6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3f47f5db/Allura/allura/config/middleware.py
----------------------------------------------------------------------
diff --git a/Allura/allura/config/middleware.py b/Allura/allura/config/middleware.py
index d549d6c..73120c3 100644
--- a/Allura/allura/config/middleware.py
+++ b/Allura/allura/config/middleware.py
@@ -106,6 +106,7 @@ def _make_core_app(root, global_conf, full_stack=True, **app_conf):
     # Required for sessions
     app = SessionMiddleware(app, config)
     # Converts exceptions to HTTP errors, shows traceback in debug mode
+    tg.error.footer_html = '<!-- %s %s -->'  # don't use TG footer with extra CSS &
images that take time to load
     app = tg.error.ErrorHandler(app, global_conf, **config['pylons.errorware'])
     # Redirect some status codes to /error/document
     if config.get('override_root') != 'task':

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3f47f5db/Allura/allura/lib/custom_middleware.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/custom_middleware.py b/Allura/allura/lib/custom_middleware.py
index 1c63867..5619dc5 100644
--- a/Allura/allura/lib/custom_middleware.py
+++ b/Allura/allura/lib/custom_middleware.py
@@ -148,10 +148,10 @@ class SSLMiddleware(object):
         elif secure:
             resp = exc.HTTPFound(location='http://' + srv_path)
 
-        if resp is None:
-            resp = req.get_response(self.app)
+        if not resp:
+            resp = self.app
         return resp(environ, start_response)
-
+    
 class AlluraTimerMiddleware(TimerMiddleware):
     def timers(self):
         import genshi


Mime
View raw message