#NEWLINE# @ asynchronous #NEWLINE# def options( self , * args , **kwargs ) : #NEWLINE# #INDENT# 'XHR cross-domain OPTIONS handler' #NEWLINE# self . enable_cache ( ) #NEWLINE# self . handle_session_cookie ( ) #NEWLINE# self . preflight ( ) #NEWLINE# if self . verify_origin ( ) : #NEWLINE# #INDENT# allowed_methods = getattr ( kwargs , 'access_methods' , 'OPTIONS, POST' ) #NEWLINE# self . set_header ( 'Access-Control-Allow-Methods' , allowed_methods ) #NEWLINE# self . set_header ( 'Allow' , allowed_methods ) #NEWLINE# self . set_status ( 204 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . set_status ( 403 ) #NEWLINE# #UNINDENT# self . finish ( )