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.

documentation: Replace deprecated request.is_ajax() method.

Anders Kaseorg87b4e9259ff5
diff --git a/zerver/views/documentation.py b/zerver/views/documentation.py
index 4c7babf557b..86afb3dc900 100644
--- a/zerver/views/documentation.py
+++ b/zerver/views/documentation.py
@@ -286,8 +286,10 @@ class IntegrationView(ApiURLView):
@has_request_variables
def integration_doc(request: HttpRequest, integration_name: str = REQ()) -> HttpResponse:
- if not request.is_ajax():
+ # FIXME: This check is jQuery-specific.
+ if request.headers.get("x-requested-with") != "XMLHttpRequest":
return HttpResponseNotFound()
+
try:
integration = INTEGRATIONS[integration_name]
except KeyError: