#NEWLINE# @ gen_test #NEWLINE# def test_cors_origin_multiple( self ) : #NEWLINE# #INDENT# self . _app . mod_opts [ 'cors_origin' ] = [ 'http://example.com' , 'http://foo.bar' ] #NEWLINE# response = ( yield self . http_client . fetch ( self . get_url ( '/login' ) , method = 'POST' , body = urlencode ( self . auth_creds ) , headers = { #NEWLINE# #INDENT# 'Content-Type' : self . content_type_map [ 'form' ] , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# token = json . loads ( response . body ) [ 'return' ] [ 0 ] [ 'token' ] #NEWLINE# url = 'ws://127.0.0.1:{0}/hook/{1}' . format ( self . get_http_port ( ) , token ) #NEWLINE# request = HTTPRequest ( url , headers = { #NEWLINE# #INDENT# 'Origin' : 'http://example.com' , #NEWLINE# 'Host' : 'example.com' , #NEWLINE# #UNINDENT# } ) #NEWLINE# ws = ( yield websocket_connect ( request ) ) #NEWLINE# ws . write_message ( 'websocket client ready' ) #NEWLINE# ws . close ( ) #NEWLINE# request = HTTPRequest ( ws , headers = { #NEWLINE# #INDENT# 'Origin' : 'http://foo.bar' , #NEWLINE# 'Host' : 'example.com' , #NEWLINE# #UNINDENT# } ) #NEWLINE# ws = ( yield websocket_connect ( request ) ) #NEWLINE# ws . write_message ( 'websocket client ready' ) #NEWLINE# ws . close ( )