mirror of
https://github.com/Eugeny/tabby-web.git
synced 2025-08-20 00:01:55 +00:00
Update settings.py
This commit is contained in:
@@ -2,6 +2,7 @@ import os
|
|||||||
import dj_database_url
|
import dj_database_url
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
@@ -238,7 +239,7 @@ if FRONTEND_URL:
|
|||||||
'x-xsrf-token',
|
'x-xsrf-token',
|
||||||
'x-requested-with',
|
'x-requested-with',
|
||||||
]
|
]
|
||||||
CSRF_TRUSTED_ORIGINS = [FRONTEND_URL]
|
CSRF_TRUSTED_ORIGINS = [urlparse(FRONTEND_URL).hostname]
|
||||||
FRONTEND_URL = FRONTEND_URL.rstrip('/')
|
FRONTEND_URL = FRONTEND_URL.rstrip('/')
|
||||||
else:
|
else:
|
||||||
FRONTEND_URL = ''
|
FRONTEND_URL = ''
|
||||||
|
Reference in New Issue
Block a user