mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
coverage: Add test for REST requests to /json API unauthed.
This commit is contained in:
@@ -104,6 +104,7 @@ def rest_dispatch(request, **kwargs):
|
||||
# If this looks like a request from a top-level page in a
|
||||
# browser, send the user to the login page
|
||||
if 'text/html' in request.META.get('HTTP_ACCEPT', ''):
|
||||
# TODO: It seems like the `?next=` part is unlikely to be helpful
|
||||
return HttpResponseRedirect('%s/?next=%s' % (settings.HOME_NOT_LOGGED_IN, request.path))
|
||||
# Ask for basic auth (email:apiKey)
|
||||
elif request.path.startswith("/api"):
|
||||
|
||||
Reference in New Issue
Block a user