Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
Allow ``domain`` to push data via the HTTP headers named in
``headers``.

As with ``allow_domain``, ``domain`` may be either a full
domain name or a wildcard. Again, use of wildcards is
discouraged for security reasons.

The value for ``headers`` should be a list of header names.

To disable Flash's requirement of security matching (e.g.,(more...)

src/d/j/django-flashpolicies-1.5/flashpolicies/tests/policies.py   django-flashpolicies(Download)
        """
        policy = policies.Policy()
        policy.allow_headers('media.example.com', ['SomeHeader'])
        policy.metapolicy(policies.SITE_CONTROL_NONE)
        self.assertEqual(len(policy.xml_dom.getElementsByTagName('allow-http-request-headers-from')), 0)
        headers = ['SomeHeader', 'SomeOtherHeader']
        policy = policies.Policy()
        policy.allow_headers(domain, headers, secure=False)
        xml_dom = policy.xml_dom
        self.assertEqual(len(xml_dom.getElementsByTagName('allow-http-request-headers-from')), 1)
        headers = ['SomeHeader', 'SomeOtherHeader']
        policy = policies.Policy()
        policy.allow_headers(domain, headers, secure=False)
        xml_dom = policy.xml_dom
        header_elem = xml_dom.getElementsByTagName('allow-http-request-headers-from')[0]

src/d/j/django-flashpolicies-1.5/flashpolicies/tests/urls.py   django-flashpolicies(Download)
def make_test_policy():
    policy = policies.Policy()
    policy.allow_domain('media.example.com')
    policy.allow_headers('media.example.com', ['SomeHeader'])
    return policy