mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
sentry: Ignore DisallowedHost messages.
This is a misconfiguration of the client, not the server.
This commit is contained in:
committed by
Tim Abbott
parent
f00ff1ef62
commit
28c627452f
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user