auth: Use HTTP status 404 for invalid realms.

Apparently, our invalid realm error page had HTTP status 200, which
could be confusing and in particular broken our mobile app's error
handling for this case.
This commit is contained in:
Tim Abbott
2019-03-11 17:56:52 -07:00
parent d75d2c9974
commit 983e24a7f5
4 changed files with 13 additions and 10 deletions

View File

@@ -373,7 +373,7 @@ class SessionHostDomainMiddleware(SessionMiddleware):
if subdomain != Realm.SUBDOMAIN_FOR_ROOT_DOMAIN:
realm = get_realm(subdomain)
if (realm is None):
return render(request, "zerver/invalid_realm.html")
return render(request, "zerver/invalid_realm.html", status=404)
"""
If request.session was modified, or if the configuration is to save the
session every time, save the changes and set a session cookie or delete