mirror of https://github.com/JohnHammond/CTFd.git
Don't redirect the /events endpoint to login (#1132)
* Detect `text/event-stream` in `authed_only` to prevent unnecessary redirects to `/login`bulk-clear-sessions
parent
a9b2fe15e3
commit
6c5c63d667
|
@ -84,7 +84,7 @@ def authed_only(f):
|
|||
if authed():
|
||||
return f(*args, **kwargs)
|
||||
else:
|
||||
if request.content_type == "application/json":
|
||||
if request.content_type == "application/json" or request.accept_mimetypes.best == "text/event-stream":
|
||||
abort(403)
|
||||
else:
|
||||
return redirect(url_for("auth.login", next=request.full_path))
|
||||
|
|
Loading…
Reference in New Issue