mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
auth: Allow easier bouncer testing in dev env.
This commit is contained in:
committed by
Tim Abbott
parent
ab633f4557
commit
8254b74019
@@ -2,6 +2,7 @@ import logging
|
||||
from functools import wraps
|
||||
from typing import Any, Callable
|
||||
|
||||
from django.conf import settings
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from django.urls import path
|
||||
from django.urls.resolvers import URLPattern
|
||||
@@ -81,8 +82,11 @@ def validate_remote_server(
|
||||
|
||||
if remote_server.deactivated:
|
||||
raise RemoteServerDeactivatedError
|
||||
|
||||
if get_subdomain(request) != Realm.SUBDOMAIN_FOR_ROOT_DOMAIN:
|
||||
if (
|
||||
get_subdomain(request) != Realm.SUBDOMAIN_FOR_ROOT_DOMAIN
|
||||
and not settings.DEVELOPMENT_DISABLE_PUSH_BOUNCER_DOMAIN_CHECK
|
||||
):
|
||||
# Sometimes we may want to test push bouncer logic in development.
|
||||
raise JsonableError(_("Invalid subdomain for push notifications bouncer"))
|
||||
RequestNotes.get_notes(request).remote_server = remote_server
|
||||
process_client(request)
|
||||
|
Reference in New Issue
Block a user