Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
uWSGI use ALLOWED_HOSTS first value as server name instead of hard-coded
Mikail KOCAK23538dad6534
diff --git a/saleor/wsgi/__init__.py b/saleor/wsgi/__init__.pyindex 2f94fb0873..5180f5497f 100644--- a/saleor/wsgi/__init__.py+++ b/saleor/wsgi/__init__.py@@ -12,12 +12,19 @@ middleware here, or combine a Django application with an application of anotherframework."""import os-import sysfrom django.core.wsgi import get_wsgi_application+from django.utils.functional import SimpleLazyObjectfrom saleor.wsgi.health_check import health_check++def get_allowed_host_lazy():+ from django.conf import settings++ return settings.ALLOWED_HOSTS[0]++os.environ.setdefault("DJANGO_SETTINGS_MODULE", "saleor.settings")# This application object is used by any WSGI server configured to use this@@ -33,11 +40,11 @@ application = health_check(application, "/health/")application({"REQUEST_METHOD": "GET",- "SERVER_NAME": "127.0.0.1",+ "SERVER_NAME": SimpleLazyObject(get_allowed_host_lazy),"REMOTE_ADDR": "127.0.0.1","SERVER_PORT": 80,"PATH_INFO": "/graphql/",- "wsgi.input": sys.stdin,+ "wsgi.input": b"",},lambda x, y: None,)