Commits

Anonymous committed 8b7dfc0

Don't assume that we always have a "Referer"-header, closes #951.

Comments (0)

Files changed (1)

     if path_info == '/logout':
         authenticator.logout()
         referer = req.get_header('Referer')
-        if referer[0:len(req.base_url)] != req.base_url:
+        if referer and referer[0:len(req.base_url)] != req.base_url:
             # only redirect to referer if the latter is from the same instance
             referer = None
         try:
         auth_cookie = authenticator.login(req)
     if path_info == '/login':
         referer = req.get_header('Referer')
-        if referer[0:len(req.base_url)] != req.base_url:
+        if referer and referer[0:len(req.base_url)] != req.base_url:
             # only redirect to referer if the latter is from the same instance
             referer = None
         try: