Skip to content

Commit 900a197

Browse files
committed
Fix pass through overrides typing
1 parent d2bb39b commit 900a197

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

jupyter_server/base/handlers.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import warnings
1515
from http.client import responses
1616
from logging import Logger
17-
from typing import TYPE_CHECKING, Any, Awaitable, Sequence, cast
17+
from typing import TYPE_CHECKING, Any, Awaitable, Coroutine, Sequence, cast
1818
from urllib.parse import urlparse
1919

2020
import prometheus_client
@@ -1016,14 +1016,14 @@ def compute_etag(self) -> str | None:
10161016
# access is allowed as this class is used to serve static assets on login page
10171017
# TODO: create an allow-list of files used on login page and remove this decorator
10181018
@allow_unauthenticated
1019-
def get(self, *args, **kwargs) -> None:
1020-
return super().get(*args, **kwargs)
1019+
def get(self, path: str, include_body: bool = ...) -> Coroutine[Any, Any, None]:
1020+
return super().get(path, include_body)
10211021

10221022
# access is allowed as this class is used to serve static assets on login page
10231023
# TODO: create an allow-list of files used on login page and remove this decorator
10241024
@allow_unauthenticated
1025-
def head(self, *args, **kwargs) -> None:
1026-
return super().head(*args, **kwargs)
1025+
def head(self, path: str) -> Awaitable[None]:
1026+
return super().head(path)
10271027

10281028
@classmethod
10291029
def get_absolute_path(cls, roots: Sequence[str], path: str) -> str:
@@ -1170,12 +1170,12 @@ class PublicStaticFileHandler(web.StaticFileHandler):
11701170
"""Same as web.StaticFileHandler, but decorated to acknowledge that auth is not required."""
11711171

11721172
@allow_unauthenticated
1173-
def head(self, *args, **kwargs) -> None:
1174-
return super().head(*args, **kwargs)
1173+
def head(self, path: str) -> Awaitable[None]:
1174+
return super().head(path)
11751175

11761176
@allow_unauthenticated
1177-
def get(self, *args, **kwargs) -> None:
1178-
return super().get(*args, **kwargs)
1177+
def get(self, path: str, include_body: bool = ...) -> Coroutine[Any, Any, None]:
1178+
return super().get(path, include_body)
11791179

11801180

11811181
# -----------------------------------------------------------------------------

jupyter_server/base/websocket.py

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ def _maybe_auth(self):
9797
self.log.warning("Couldn't authenticate WebSocket connection")
9898
raise web.HTTPError(403)
9999

100+
@no_type_check
100101
def prepare(self, *args, **kwargs):
101102
"""Handle a get request."""
102103
self._maybe_auth()

0 commit comments

Comments
 (0)