File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
plain/plain/internal/handlers Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 44from opentelemetry import baggage , trace
55from opentelemetry .semconv .attributes import http_attributes , url_attributes
66
7- from plain .exceptions import ImproperlyConfigured
7+ from plain .exceptions import DisallowedHost , ImproperlyConfigured
88from plain .logs .utils import log_response
99from plain .runtime import settings
1010from plain .urls import get_resolver
@@ -78,6 +78,10 @@ def get_response(self, request):
7878 except KeyError :
7979 # Missing required WSGI environment variables (e.g. in tests)
8080 pass
81+ except DisallowedHost :
82+ # Invalid host header - skip URL_FULL for telemetry but let the
83+ # exception be handled normally by middleware for proper 400 response
84+ pass
8185
8286 # Add query string if present
8387 if query_string := request .meta .get ("QUERY_STRING" ):
You can’t perform that action at this time.
0 commit comments