2017-01-30 07:21:13 +01:00
|
|
|
|
|
|
|
from django.http import HttpResponse, HttpRequest
|
|
|
|
from typing import Any, List, Dict, Optional, Text
|
|
|
|
|
|
|
|
from zerver.lib.response import json_error, json_success
|
|
|
|
from zerver.lib.user_agent import parse_user_agent
|
|
|
|
|
2017-10-27 02:18:49 +02:00
|
|
|
def check_compatibility(request: HttpRequest) -> HttpResponse:
|
2017-01-30 07:21:13 +01:00
|
|
|
user_agent = parse_user_agent(request.META["HTTP_USER_AGENT"])
|
2018-03-22 20:02:15 +01:00
|
|
|
if user_agent['name'] == "ZulipInvalid":
|
2017-01-30 07:21:13 +01:00
|
|
|
return json_error("Client is too old")
|
|
|
|
return json_success()
|