FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 3ca45ce1 authored by Mike Knee's avatar Mike Knee
Browse files

fix: include cors app correctly

parent f2714d0a
No related branches found
No related tags found
1 merge request!102Update CORS settings to allow for recaptcha token to be provided in headers
Pipeline #696017 passed
...@@ -4,6 +4,7 @@ from datetime import timedelta ...@@ -4,6 +4,7 @@ from datetime import timedelta
import externalsettings import externalsettings
import structlog import structlog
from corsheaders.defaults import default_headers
from api.versions import AVAILABLE_VERSIONS from api.versions import AVAILABLE_VERSIONS
...@@ -72,6 +73,7 @@ INSTALLED_APPS = [ ...@@ -72,6 +73,7 @@ INSTALLED_APPS = [
"django_filters", "django_filters",
"drf_spectacular", "drf_spectacular",
"rest_framework", "rest_framework",
"corsheaders",
"knox", "knox",
"activate_account", "activate_account",
"api", "api",
...@@ -230,6 +232,12 @@ SPECTACULAR_SETTINGS = { ...@@ -230,6 +232,12 @@ SPECTACULAR_SETTINGS = {
# Allow all origins to access API. # Allow all origins to access API.
CORS_URLS_REGEX = r"^.*$" CORS_URLS_REGEX = r"^.*$"
CORS_ORIGIN_ALLOW_ALL = True CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOW_HEADERS = (
*default_headers,
"Sec-Ch-Ua",
"Sec-Ch-Ua-Mobile",
"Sec-Ch-Ua-Platform",
)
SWAGGER_SETTINGS = { SWAGGER_SETTINGS = {
# Describe token authentication in swagger definition # Describe token authentication in swagger definition
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment