Skip to content

Instantly share code, notes, and snippets.

Avatar

James Brooking jambroo

View GitHub Profile
@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.