From 6f40e43928af6296ee3058445b00eda37c9323b8 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sat, 21 Jun 2008 22:51:38 -0400 Subject: [PATCH] Redirect overlord -> overlord/ and use relative redirects. svn path=/trunk/packages/sipb-xen-www/; revision=633 --- code/main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/main.py b/code/main.py index 2740a74..9d39df6 100755 --- a/code/main.py +++ b/code/main.py @@ -341,7 +341,7 @@ def command(username, state, path, fields): elif back == 'info': machine = validation.Validate(username, state, machine_id=fields.getfirst('machine_id')).machine return ({'Status': '303 See Other', - 'Location': '/info?machine_id=%d' % machine.machine_id}, + 'Location': 'info?machine_id=%d' % machine.machine_id}, "You shouldn't see this message.") else: raise InvalidInput('back', back, 'Not a known back page.') @@ -585,6 +585,10 @@ def unauthFront(_, _2, _3, fields): return templates.unauth(searchList=[{'simple' : True}]) def overlord(username, state, path, fields): + if path == '': + return ({'Status': '303 See Other', + 'Location': 'overlord/'}, + "You shouldn't see this message.") if not username in getAfsGroupMembers('system:xvm', 'athena.mit.edu'): raise InvalidInput('username', username, 'Not an overlord.') newstate = State(username, overlord=True) @@ -666,8 +670,7 @@ class App: fields = cgi.FieldStorage(fp=self.environ['wsgi.input'], environ=self.environ) operation = self.environ.get('PATH_INFO', '') if not operation: - self.start("301 Moved Permanently", [('Location', - self.environ['SCRIPT_NAME']+'/')]) + self.start("301 Moved Permanently", [('Location', './')]) return if self.username is None: operation = 'unauth' -- 1.7.9.5