Avoid the redirection loop (fixes #571)
This commit is contained in:
parent
5f26c131a9
commit
4b87cb9181
@ -223,8 +223,14 @@ class Application(object):
|
||||
status, headers, answer = function(
|
||||
environ, calendars, content, user)
|
||||
elif user and last_allowed is None:
|
||||
# Good user and no calendars found, redirect user to home
|
||||
# Good user and no calendars found
|
||||
location = "/%s/" % str(quote(user))
|
||||
if location == environ["PATH_INFO"]:
|
||||
# We already have redirected the client
|
||||
status, headers, answer = function(
|
||||
environ, calendars, content, user)
|
||||
else:
|
||||
# Redirect the client
|
||||
log.LOGGER.info("redirecting to %s" % location)
|
||||
status = client.FOUND
|
||||
headers = {"Location": location}
|
||||
|
Loading…
Reference in New Issue
Block a user