Skip to content

Instantly share code, notes, and snippets.

Avatar

Kamal Gill kamalgill

View GitHub Profile
@kamalgill
kamalgill / cors-xml-schema.rng.xml
Last active Sep 20, 2018
AWS S3 CORS XML RelaxNG schema
View cors-xml-schema.rng.xml
<element name="CORSConfiguration" xmlns="http://relaxng.org/ns/structure/1.0">
<oneOrMore>
<element name="CORSRule">
<interleave>
<oneOrMore>
<element name="AllowedOrigin"><text /></element>
</oneOrMore>
<oneOrMore>
<element name="AllowedMethod">
<choice>
@kamalgill
kamalgill / cors.py
Created Mar 18, 2016 — forked from mmerickel/cors.py
cors in pyramid
View cors.py
from pyramid.security import NO_PERMISSION_REQUIRED
def includeme(config):
config.add_directive(
'add_cors_preflight_handler', add_cors_preflight_handler)
config.add_route_predicate('cors_preflight', CorsPreflightPredicate)
config.add_subscriber(add_cors_to_response, 'pyramid.events.NewResponse')
class CorsPreflightPredicate(object):
You can’t perform that action at this time.