Skip to content

Commit bf341dc

Browse files
committed
fix: cors and csrf stuff
1 parent 502dc15 commit bf341dc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ledger/settings.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@
2626
# SECURITY WARNING: don't run with debug turned on in production!
2727
DEBUG = bool(os.environ.get("DJANGO_DEBUG", default="1"))
2828

29-
ALLOWED_HOSTS = ["*"] if DEBUG else ["localhost", "127.0.0.1", "https://ledger.unitystation.org"]
29+
ALLOWED_HOSTS = ["*"] if DEBUG else ["localhost", "127.0.0.1", "ledger.unitystation.org"]
30+
31+
# CSRF
32+
CSRF_TRUSTED_ORIGINS = ['https://ledger.unitystation.org']
33+
CORS_ORIGIN_ALLOW_ALL = DEBUG
34+
CORS_ALLOWED_ORIGINS = ['https://ledger.unitystation.org']
35+
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
3036

3137
# Application definition
3238

0 commit comments

Comments
 (0)