Add cors allow headers and origin whitelist
+from corsheaders.defaults import default_headers
+
from polyaxon.utils import ROOT_DIR, config
DEBUG = config.get_boolean('POLYAXON_DEBUG')
@@ -10,6 +12,15 @@ CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOW_CREDENTIALS = True
SSL_ENABLE = config.get_boolean('POLYAXON_SSL_ENABLE', is_optional=True, default=False)
+CORS_ORIGIN_WHITELIST = config.get_string('POLYAXON_CORS_ORIGIN_WHITELIST',
+ is_optional=True,
+ default=False)
+
+CORS_ALLOW_HEADERS = default_headers + (
+ 'x-polyaxon-cli-version',
+ 'x-polyaxon-client-version',
+)
+
if SSL_ENABLE:
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
