Skip to content

Commit

Permalink
Allow new file types (jupyter-server#895)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart authored and mlhenderson committed Jul 28, 2022
1 parent 45afcc6 commit 63446c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jupyter_server/services/contents/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ async def get(self, path=""):

type = self.get_query_argument("type", default=None)
if type not in {None, "directory", "file", "notebook"}:
raise web.HTTPError(400, "Type %r is invalid" % type)
# fall back to file if unknown type
type = "file"

format = self.get_query_argument("format", default=None)
if format not in {None, "text", "base64"}:
Expand Down Expand Up @@ -222,6 +223,9 @@ async def post(self, path=""):
copy_from = model.get("copy_from")
ext = model.get("ext", "")
type = model.get("type", "")
if type not in {None, "", "directory", "file", "notebook"}:
# fall back to file if unknown type
type = "file"
if copy_from:
await self._copy(copy_from, path)
else:
Expand Down

0 comments on commit 63446c5

Please sign in to comment.