Skip to content

Test RIA cross domain policy

test-ria-cross-domain-policy.py


import urllib.request
import urllib.parse

ria_meta_file = ['crossdomain.xml', 'clientaccesspolicy.xml']

page_url = 'https://twitter.com/'

for _file in ria_meta_file:
    print("------ File test: " + _file + " ------")
    try:
        req = urllib.request.Request(
                page_url + _file,
                method='GET'
        )

        response = urllib.request.urlopen(req)
        body = response.read().decode('utf8')
        print(body)

    except:
        print('Error')