cleanup ALLOWED_HOSTS, using an allowed host in a fake request

parent 48b4b8d0
Pipeline #34403571 passed with stages
in 21 minutes and 33 seconds
......@@ -1608,7 +1608,9 @@ def calculate_map_data(days: int = 366):
# fake request
from django.test.client import RequestFactory
rf = RequestFactory()
get_request = rf.get('/hello/', HTTP_HOST='localhost')
from django.conf import settings
get_request = rf.get('/', HTTP_HOST=settings.ALLOWED_HOSTS[0])
# all vulnerabilities * 14 days
filters = ["security_headers_strict_transport_security", "security_headers_x_content_type_options", "ftp", "DNSSEC",
......
......@@ -53,7 +53,7 @@ SECRET_KEY = os.environ.get('SECRET_KEY', 'ditisgeengeheimvriendachtjedatditeenw
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.environ.get('DEBUG', False)
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', 'localhost,127.0.0.1,::1,100.66.10.138,100.66.10.142').split(',')
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', 'localhost,127.0.0.1,::1').split(',')
# allow better debugging for these clients
# https://docs.djangoproject.com/en/1.11/ref/settings/#internal-ips
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment