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/09/20 19:51:40 UTC
git commit: [#6668] Always use https
Updated Branches:
refs/heads/cj/6668b [created] e7531896b
[#6668] Always use https
Signed-off-by: Cory Johns <cj...@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 <cj...@slashdotmedia.com>
Authored: Fri Sep 20 17:51:06 2013 +0000
Committer: Cory Johns <cj...@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