You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/04/25 00:30:38 UTC
[13/50] git commit: [#6093] better middleware response,
so WebError works
[#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 <db...@slashdotmedia.com>
Authored: Mon Apr 22 19:44:23 2013 +0000
Committer: Cory Johns <cj...@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