1.1 --- a/WebStack/Resources/Login.py Wed Nov 16 18:26:51 2005 +0000
1.2 +++ b/WebStack/Resources/Login.py Wed Nov 16 18:27:07 2005 +0000
1.3 @@ -88,7 +88,7 @@
1.4 if fields_body.has_key("login"):
1.5 if self.authenticator.authenticate(trans):
1.6 self._redirect(trans, app, path, qs)
1.7 - return
1.8 + # The above method does not return.
1.9
1.10 # Otherwise, show the login form.
1.11
1.12 @@ -101,13 +101,13 @@
1.13 details.
1.14 """
1.15
1.16 - if self.use_redirect:
1.17 - trans.set_header_value("Location", app + trans.encode_path(path, self.urlencoding) + qs)
1.18 - trans.set_response_code(302) # was 307
1.19 -
1.20 # Show the success page anyway.
1.21
1.22 self._show_success(trans, app, path, qs)
1.23 + if self.use_redirect:
1.24 + trans.redirect(app + trans.encode_path(path, self.urlencoding) + qs)
1.25 + else:
1.26 + raise WebStack.Generic.EndOfResponse
1.27
1.28 def _show_login(self, trans, app, path, qs):
1.29
2.1 --- a/WebStack/Resources/LoginRedirect.py Wed Nov 16 18:26:51 2005 +0000
2.2 +++ b/WebStack/Resources/LoginRedirect.py Wed Nov 16 18:27:07 2005 +0000
2.3 @@ -116,14 +116,12 @@
2.4 qs = trans.get_query_string()
2.5 if qs:
2.6 qs = "?" + qs
2.7 -
2.8 - trans.set_header_value("Location", "%s?app=%s&path=%s&qs=%s" % (
2.9 + trans.redirect("%s?app=%s&path=%s&qs=%s" % (
2.10 self.login_url,
2.11 trans.encode_path(self.app_url, self.urlencoding),
2.12 trans.encode_path(path, self.urlencoding),
2.13 trans.encode_path(qs, self.urlencoding))
2.14 - )
2.15 - trans.set_response_code(302) # was 307
2.16 + )
2.17
2.18 def _show_logout(self, trans, redirect):
2.19
3.1 --- a/WebStack/Resources/ResourceMap.py Wed Nov 16 18:26:51 2005 +0000
3.2 +++ b/WebStack/Resources/ResourceMap.py Wed Nov 16 18:27:07 2005 +0000
3.3 @@ -163,9 +163,6 @@
3.4 query_string = trans.get_query_string()
3.5 if query_string:
3.6 query_string = "?" + query_string
3.7 -
3.8 - trans.set_response_code(302)
3.9 - trans.set_header_value("Location", trans.encode_path(path_without_query, self.urlencoding) + "/" + query_string)
3.10 - raise WebStack.Generic.EndOfResponse
3.11 + trans.redirect(trans.encode_path(path_without_query, self.urlencoding) + "/" + query_string)
3.12
3.13 # vim: tabstop=4 expandtab shiftwidth=4