redirects according to http spec

This commit is contained in:
Martijn Voncken 2008-10-23 18:41:07 +00:00
parent 0896856908
commit 1aa33421e9
1 changed files with 3 additions and 2 deletions

View File

@ -75,8 +75,9 @@ def redirect(url, status='301 Moved Permanently'):
# if newloc is relative then make it absolute
#mvoncken:Disabled because we don't want to redirect to localhost!
#if newloc.startswith('/'):
# newloc = web.ctx.home + newloc
#mvoncken:back to http-spec, maybe better.
if newloc.startswith('/'):
newloc = web.ctx.home + newloc
web.ctx.status = status
web.ctx.output = ''