Skip to content

Commit b050a8e

Browse files
authored
Merge branch 'main' into identity
2 parents f2740d7 + e59610b commit b050a8e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ repos:
3030
files: \.py$
3131

3232
- repo: https://github.com/pre-commit/mirrors-mypy
33-
rev: v0.961
33+
rev: v0.971
3434
hooks:
3535
- id: mypy
3636
additional_dependencies: [types-requests]
@@ -41,7 +41,7 @@ repos:
4141
- id: prettier
4242

4343
- repo: https://github.com/asottile/pyupgrade
44-
rev: v2.37.1
44+
rev: v2.37.2
4545
hooks:
4646
- id: pyupgrade
4747
args: [--py37-plus]
@@ -67,13 +67,13 @@ repos:
6767
stages: [manual]
6868

6969
- repo: https://github.com/pre-commit/mirrors-eslint
70-
rev: v8.19.0
70+
rev: v8.20.0
7171
hooks:
7272
- id: eslint
7373
stages: [manual]
7474

7575
- repo: https://github.com/sirosen/check-jsonschema
76-
rev: 0.17.0
76+
rev: 0.17.1
7777
hooks:
7878
- id: check-jsonschema
7979
name: "Check GitHub Workflows"

jupyter_server/services/contents/handlers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ async def get(self, path=""):
9999

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

104105
format = self.get_query_argument("format", default=None)
105106
if format not in {None, "text", "base64"}:
@@ -222,6 +223,9 @@ async def post(self, path=""):
222223
copy_from = model.get("copy_from")
223224
ext = model.get("ext", "")
224225
type = model.get("type", "")
226+
if type not in {None, "", "directory", "file", "notebook"}:
227+
# fall back to file if unknown type
228+
type = "file"
225229
if copy_from:
226230
await self._copy(copy_from, path)
227231
else:

0 commit comments

Comments
 (0)