You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2020/02/26 19:56:56 UTC
[allura] 02/02: Handle str vs unicode in ApacheAccessHandler.py
This is an automated email from the ASF dual-hosted git repository.
brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git
commit 03d9ac0ffa44156b0a9a53ad259f5a54b9542876
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Wed Feb 26 14:56:26 2020 -0500
Handle str vs unicode in ApacheAccessHandler.py
---
scripts/ApacheAccessHandler.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/ApacheAccessHandler.py b/scripts/ApacheAccessHandler.py
index 39c35b6..4632541 100644
--- a/scripts/ApacheAccessHandler.py
+++ b/scripts/ApacheAccessHandler.py
@@ -45,7 +45,7 @@ def log(req, message):
def load_requests_lib(req):
- virtualenv_path = req.get_options().get('ALLURA_VIRTUALENV', None)
+ virtualenv_path = req.get_options().get(str('ALLURA_VIRTUALENV'), None)
if virtualenv_path:
activate_this = '%s/bin/activate_this.py' % virtualenv_path
exec(compile(open(activate_this, "rb").read(), activate_this, 'exec'), {'__file__': activate_this})
@@ -104,7 +104,7 @@ def check_authentication(req):
log(req, "checking auth for: %s" % username)
if not username or not password:
return False
- auth_url = req.get_options().get('ALLURA_AUTH_URL', 'https://127.0.0.1/auth/do_login')
+ auth_url = req.get_options().get(str('ALLURA_AUTH_URL'), 'https://127.0.0.1/auth/do_login')
# work through our own Antispam protection
auth_form_url = auth_url.replace('/do_login', '/')
@@ -175,7 +175,7 @@ def check_authentication(req):
def check_permissions(req):
req_path = str(req.parsed_uri[apache.URI_PATH])
req_query = str(req.parsed_uri[apache.URI_QUERY])
- perm_url = req.get_options().get('ALLURA_PERM_URL', 'https://127.0.0.1/auth/repo_permissions')
+ perm_url = req.get_options().get(str('ALLURA_PERM_URL'), 'https://127.0.0.1/auth/repo_permissions')
r = requests.get(perm_url, params={'username': req.user, 'repo_path': mangle(req_path)})
if r.status_code != 200:
log(req, "repo_permissions return error (%d)" % r.status_code)