Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

sentry: Ignore DisallowedHost messages.

Alex Vandiver28c627452fbc
diff --git a/zerver/middleware.py b/zerver/middleware.py
index 42d9fa5b9ed..31ab5af5833 100644
--- a/zerver/middleware.py
+++ b/zerver/middleware.py
@@ -384,6 +384,10 @@ class FlushDisplayRecipientCache(MiddlewareMixin):
return response
class HostDomainMiddleware(MiddlewareMixin):
+ def __init__(self, get_response: Callable[[Any, WSGIRequest], Union[HttpResponse, BaseException]]) -> None:
+ super().__init__(get_response)
+ ignore_logger("django.security.DisallowedHost")
+
def process_request(self, request: HttpRequest) -> Optional[HttpResponse]:
# Match against ALLOWED_HOSTS, which is rather permissive;
# failure will raise DisallowedHost, which is a 400.