def do_POST(self): #@@refactor to use same code as GET try: fn = functorFromUrl(self.path) if not isAuthorized(self): handlers.handleNotAuthorized(self) return if fn is not None: fn(self) else: handlers.handleNotFound(self) except BaseException as e: exc_type, exc_value, exc_traceback = sys.exc_info() log.error("".join(traceback.format_exception(exc_type, exc_value,exc_traceback)))
def do_GET(self): try: fn = functorFromUrl(self.path) # Bypass authorization for set cookie url if re.search('^/set_cookie/.*', self.path): handlers.handleSetToken(self) return if not isAuthorized(self): handlers.handleNotAuthorized(self) return if fn is not None: fn(self) else: handlers.handleNotFound(self) except BaseException as e: exc_type, exc_value, exc_traceback = sys.exc_info() log.error("".join(traceback.format_exception(exc_type, exc_value,exc_traceback)))