From f53da87f6fddcdea177aa2fe34ce2b025d6aabfa Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sat, 16 Nov 2013 03:23:03 -0600 Subject: [PATCH] fixed 1774:CAS client broken when using routes.py, thanks remco.boerma --- VERSION | 2 +- gluon/contrib/login_methods/cas_auth.py | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/VERSION b/VERSION index d61072d9..d563a509 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.7.4-stable+timestamp.2013.11.16.03.15.58 +Version 2.7.4-stable+timestamp.2013.11.16.03.22.18 diff --git a/gluon/contrib/login_methods/cas_auth.py b/gluon/contrib/login_methods/cas_auth.py index 54abf92e..12e59972 100644 --- a/gluon/contrib/login_methods/cas_auth.py +++ b/gluon/contrib/login_methods/cas_auth.py @@ -9,7 +9,7 @@ License: GPL v2 Tinkered by Szabolcs Gyuris < szimszo n @ o regpreshaz dot eu> """ -from gluon import current, redirect +from gluon import current, redirect, URL class CasAuth(object): @@ -56,15 +56,9 @@ class CasAuth(object): self.maps = maps self.casversion = casversion self.casusername = casusername - http_host = current.request.env.http_x_forwarded_host - if not http_host: - http_host = current.request.env.http_host - if current.request.env.wsgi_url_scheme in ['https', 'HTTPS']: - scheme = 'https' - else: - scheme = 'http' - self.cas_my_url = '%s://%s%s' % ( - scheme, http_host, current.request.env.path_info) + self.cas_my_url = URL(args=current.request.args, + vars=current.request.vars, + scheme=True) def login_url(self, next="/"): current.session.token = self._CAS_login()