@jupyterlite/server 0.1.0-alpha.14 → 0.1.0-alpha.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/server.js +6 -0
  2. package/package.json +6 -6
package/lib/server.js CHANGED
@@ -61,6 +61,9 @@ export class JupyterServer {
61
61
  content: ((_a = req.query) === null || _a === void 0 ? void 0 : _a.content) === '1'
62
62
  };
63
63
  const nb = await this._contents.get(filename, options);
64
+ if (!nb) {
65
+ return new Response(null, { status: 404 });
66
+ }
64
67
  return new Response(JSON.stringify(nb));
65
68
  });
66
69
  // POST /api/contents/{path} - Create a new file in the specified path
@@ -74,6 +77,9 @@ export class JupyterServer {
74
77
  else {
75
78
  file = await this._contents.newUntitled(options);
76
79
  }
80
+ if (!file) {
81
+ return new Response(null, { status: 400 });
82
+ }
77
83
  return new Response(JSON.stringify(file), { status: 201 });
78
84
  });
79
85
  // PATCH /api/contents/{path} - Rename a file or directory without re-uploading content
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyterlite/server",
3
- "version": "0.1.0-alpha.14",
3
+ "version": "0.1.0-alpha.18",
4
4
  "description": "JupyterLite - Server",
5
5
  "homepage": "https://github.com/jupyterlite/jupyterlite",
6
6
  "bugs": {
@@ -48,11 +48,11 @@
48
48
  "@jupyterlab/services": "~6.2.0",
49
49
  "@jupyterlab/settingregistry": "~3.2.0",
50
50
  "@jupyterlab/statedb": "~3.2.0",
51
- "@jupyterlite/contents": "^0.1.0-alpha.14",
52
- "@jupyterlite/kernel": "^0.1.0-alpha.14",
53
- "@jupyterlite/session": "^0.1.0-alpha.14",
54
- "@jupyterlite/settings": "^0.1.0-alpha.14",
55
- "@jupyterlite/translation": "^0.1.0-alpha.14",
51
+ "@jupyterlite/contents": "^0.1.0-alpha.18",
52
+ "@jupyterlite/kernel": "^0.1.0-alpha.18",
53
+ "@jupyterlite/session": "^0.1.0-alpha.18",
54
+ "@jupyterlite/settings": "^0.1.0-alpha.18",
55
+ "@jupyterlite/translation": "^0.1.0-alpha.18",
56
56
  "@lumino/application": "^1.20.0",
57
57
  "@lumino/coreutils": "^1.8.0",
58
58
  "mock-socket": "^9.0.3"