/usr/lib/python2.7/dist-packages/corsheaders/conf.py is in python-django-cors-headers 2.1.0+github-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | from django.conf import settings
from .defaults import default_headers, default_methods # Kept here for backwards compatibility
class Settings(object):
"""
Shadow Django's settings with a little logic
"""
@property
def CORS_ALLOW_HEADERS(self):
return getattr(settings, 'CORS_ALLOW_HEADERS', default_headers)
@property
def CORS_ALLOW_METHODS(self):
return getattr(settings, 'CORS_ALLOW_METHODS', default_methods)
@property
def CORS_ALLOW_CREDENTIALS(self):
return getattr(settings, 'CORS_ALLOW_CREDENTIALS', False)
@property
def CORS_PREFLIGHT_MAX_AGE(self):
return getattr(settings, 'CORS_PREFLIGHT_MAX_AGE', 86400)
@property
def CORS_ORIGIN_ALLOW_ALL(self):
return getattr(settings, 'CORS_ORIGIN_ALLOW_ALL', False)
@property
def CORS_ORIGIN_WHITELIST(self):
return getattr(settings, 'CORS_ORIGIN_WHITELIST', ())
@property
def CORS_ORIGIN_REGEX_WHITELIST(self):
return getattr(settings, 'CORS_ORIGIN_REGEX_WHITELIST', ())
@property
def CORS_EXPOSE_HEADERS(self):
return getattr(settings, 'CORS_EXPOSE_HEADERS', ())
@property
def CORS_URLS_REGEX(self):
return getattr(settings, 'CORS_URLS_REGEX', r'^.*$')
@property
def CORS_MODEL(self):
return getattr(settings, 'CORS_MODEL', None)
@property
def CORS_REPLACE_HTTPS_REFERER(self):
return getattr(settings, 'CORS_REPLACE_HTTPS_REFERER', False)
conf = Settings()
|