incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [13/50] git commit: [#6093] better middleware response, so WebError works
Date Wed, 24 Apr 2013 22:30:38 GMT
[#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/3f9ff9a5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/3f9ff9a5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/3f9ff9a5

Branch: refs/heads/cj/5655
Commit: 3f9ff9a5582cac80c2587083c22e01d579240bb2
Parents: e6136bd
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Mon Apr 22 19:44:23 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Wed Apr 24 13:44:40 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/3f9ff9a5/Allura/allura/config/middleware.py
----------------------------------------------------------------------
diff --git a/Allura/allura/config/middleware.py b/Allura/allura/config/middleware.py
index 9cadf6b..a877221 100644
--- a/Allura/allura/config/middleware.py
+++ b/Allura/allura/config/middleware.py
@@ -124,6 +124,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/3f9ff9a5/Allura/allura/lib/custom_middleware.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/custom_middleware.py b/Allura/allura/lib/custom_middleware.py
index 1a1b678..6633489 100644
--- a/Allura/allura/lib/custom_middleware.py
+++ b/Allura/allura/lib/custom_middleware.py
@@ -165,10 +165,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