Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

fix: add conditional trusted origins update #563

Merged
merged 4 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions registrar/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
CSRF_TRUSTED_ORIGINS = []
CSRF_TRUSTED_ORIGINS_WITH_SCHEMES = [] # temporary setting for Django 4.2 support
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
Expand Down
4 changes: 4 additions & 0 deletions registrar/settings/production.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from os import environ
import django

Check warning on line 2 in registrar/settings/production.py

View check run for this annotation

Codecov / codecov/patch

registrar/settings/production.py#L2

Added line #L2 was not covered by tests
import yaml

from registrar.settings.base import *
Expand Down Expand Up @@ -53,3 +54,6 @@
CELERY_BROKER_HOSTNAME,
CELERY_BROKER_VHOST
)

if django.VERSION[0] >= 4: # for greater than django 3.2 use schemes.
CSRF_TRUSTED_ORIGINS = CSRF_TRUSTED_ORIGINS_WITH_SCHEMES

Check warning on line 59 in registrar/settings/production.py

View check run for this annotation

Codecov / codecov/patch

registrar/settings/production.py#L59

Added line #L59 was not covered by tests
Loading