diff --git a/apiserver/plane/settings/common.py b/apiserver/plane/settings/common.py index 364401f1b4..9d270662eb 100644 --- a/apiserver/plane/settings/common.py +++ b/apiserver/plane/settings/common.py @@ -21,7 +21,6 @@ INSTALLED_APPS = [ "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions", - "corsheaders", # Inhouse apps "plane.analytics", "plane.api", diff --git a/apiserver/plane/settings/production.py b/apiserver/plane/settings/production.py index 1b6ac2cf75..526b626d0a 100644 --- a/apiserver/plane/settings/production.py +++ b/apiserver/plane/settings/production.py @@ -49,6 +49,36 @@ ALLOWED_HOSTS = ["*"] # TODO: Make it FALSE and LIST DOMAINS IN FULL PROD. CORS_ALLOW_ALL_ORIGINS = True +CORS_ALLOWED_ORIGINS = [ +"*" +] + +CORS_ALLOWED_ORIGIN_REGEXES = [ +r"^https://\w+\.domain\.com$", +] + +CORS_ALLOW_METHODS = [ +'DELETE', +'GET', +'OPTIONS', +'PATCH', +'POST', +'PUT', +] + +CORS_ALLOW_HEADERS = [ +'accept', +'accept-encoding', +'authorization', +'content-type', +'dnt', +'origin', +'user-agent', +'x-csrftoken', +'x-requested-with', +] + +CORS_ALLOW_CREDENTIALS = True # Simplified static file serving. STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"