Skip to content

Commit

Permalink
ensure user is defined in early short-circuit requests (#833)
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed May 4, 2022
1 parent 321f5a9 commit 4374a35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jupyter_server/base/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ def check_host(self):

async def prepare(self):
if not self.check_host():
self.current_user = self._jupyter_current_user = None
raise web.HTTPError(403)

from jupyter_server.auth import IdentityProvider
Expand Down Expand Up @@ -802,7 +803,8 @@ def options(self, *args, **kwargs):
class Template404(JupyterHandler):
"""Render our 404 template"""

def prepare(self):
async def prepare(self):
await super().prepare()
raise web.HTTPError(404)


Expand Down

0 comments on commit 4374a35

Please sign in to comment.