summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2015-03-06 12:12:00 -0500
committerSimo Sorce <simo@redhat.com>2015-03-06 15:02:33 -0500
commitd07fc49b83801a985516d5fd299717f4c4e7abff (patch)
tree7f218c35ddc007053df082964db0876ce59a4c85
parent06b387bcc632a8db9e812c9069247b10fe2b9695 (diff)
downloadipsilon-ticket-74.zip
ipsilon-ticket-74.tar.gz
ipsilon-ticket-74.tar.xz
Find transaction ids for internal redirectsticket-74
On internal redirections, such as when ErrorDocument is used to redirect on failed negotiate authentication we need to look harder for the transaction id. Ticket: #74 Signed-off-by: Simo Sorce <simo@redhat.com>
-rw-r--r--ipsilon/util/page.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/ipsilon/util/page.py b/ipsilon/util/page.py
index f4e53d6..50585ca 100644
--- a/ipsilon/util/page.py
+++ b/ipsilon/util/page.py
@@ -138,9 +138,15 @@ class Page(Endpoint):
# Try with kwargs first
tid = t.find_tid(kwargs)
if not tid:
- # If no TID yet See if we have it in a referer
+ # If no TID yet See if we have it in a referer or in the
+ # environment in the REDIRECT_URL
+ url = None
if 'referer' in cherrypy.request.headers:
- r = urlparse(unquote(cherrypy.request.headers['referer']))
+ url = cherrypy.request.headers['referer']
+ elif 'REQUEST_URI' in cherrypy.request.wsgi_environ:
+ url = cherrypy.request.wsgi_environ['REQUEST_URI']
+ if url:
+ r = urlparse(unquote(url))
if r.query:
tid = t.find_tid(parse_qs(r.query))
if not tid: