From 5146135b9fe0ff64d60dbbc50f0f8497b57a1e8a Mon Sep 17 00:00:00 2001 From: "Afshin T. Darian" Date: Wed, 17 Mar 2021 14:18:15 +0000 Subject: [PATCH] Fix for the terminal shutdown issue --- jupyter_server/terminal/handlers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jupyter_server/terminal/handlers.py b/jupyter_server/terminal/handlers.py index d01edd38e0..415df7be93 100644 --- a/jupyter_server/terminal/handlers.py +++ b/jupyter_server/terminal/handlers.py @@ -22,6 +22,8 @@ def origin_check(self): def get(self, *args, **kwargs): if not self.get_current_user(): raise web.HTTPError(403) + if not args[0] in self.term_manager.terminals: + raise web.HTTPError(404) return super(TermSocket, self).get(*args, **kwargs) def on_message(self, message):