Permalink
Browse files

web: fix POST /logout

  • Loading branch information...
1 parent 45b2c49 commit c5ac0c2aea10bc06ac3d574e6fe8401bd238f522 @billiob billiob committed Aug 24, 2010
Showing with 10 additions and 0 deletions.
  1. +1 −0 amsn2/ui/front_ends/web/bend.py
  2. +9 −0 amsn2/ui/front_ends/web/tinyhttpserver.py
@@ -197,6 +197,7 @@ def post_close_cw(self, w, uri, headers, body = None):
def post_logout(self, w, uri, headers, body = None):
if self._core._account:
self._core.sign_out_of_account()
+ print "<<< logout"
w.write("HTTP/1.1 200 OK\r\n\r\n")
w.close()
return
@@ -90,6 +90,15 @@ def on_headers(self, headers):
self._rcb = self.on_body
self._bytes_to_read = r
else:
+ for (r, _, post_cb) in self._rules:
+ if r.match(path) and post_cb:
+ try:
+ post_cb(self, self._uri, self._headers)
+ except Exception as e:
+ traceback.print_exc()
+ self._500()
+ finally:
+ return
self._400()
else:
self._400()

0 comments on commit c5ac0c2

Please sign in to comment.