From: Anders Kaseorg Date: Sun, 22 Jun 2008 02:51:38 +0000 (-0400) Subject: Redirect overlord -> overlord/ and use relative redirects. X-Git-Tag: sipb-xen-www/3.6~29 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/6f40e43928af6296ee3058445b00eda37c9323b8 Redirect overlord -> overlord/ and use relative redirects. svn path=/trunk/packages/sipb-xen-www/; revision=633 --- 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'