incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject git commit: [#6668] Always use https
Date Fri, 20 Sep 2013 17:51:40 GMT
Updated Branches:
  refs/heads/cj/6668b [created] e7531896b


[#6668] Always use https

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


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

Branch: refs/heads/cj/6668b
Commit: e7531896bbdfa4c2e3bf2c323b5daf4b33016025
Parents: d83c5c2
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Fri Sep 20 17:51:06 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Fri Sep 20 17:51:28 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/custom_middleware.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e7531896/Allura/allura/lib/custom_middleware.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/custom_middleware.py b/Allura/allura/lib/custom_middleware.py
index d4652ab..a5ec8c3 100644
--- a/Allura/allura/lib/custom_middleware.py
+++ b/Allura/allura/lib/custom_middleware.py
@@ -158,13 +158,8 @@ class SSLMiddleware(object):
             request_uri.decode('ascii')
         except UnicodeError:
             resp = exc.HTTPNotFound()
-        secure = req.environ.get('HTTP_X_SFINC_SSL', 'false') == 'true'
-        srv_path = req.url.split('://', 1)[-1]
-        if req.cookies.get('SFUSER'):
-            if not secure:
-                resp = exc.HTTPFound(location='https://' + srv_path)
-        elif secure:
-            resp = exc.HTTPFound(location='http://' + srv_path)
+        if request_uri.startswith('http://'):
+            resp = exc.HTTPFound(location=request_uri.replace('http://', 'https://', 1))
 
         if not resp:
             resp = self.app


Mime
View raw message