pinokiod 2.15.34 → 2.15.37

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/package.json +1 -1
  2. package/server/index.js +9 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "2.15.34",
3
+ "version": "2.15.37",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -602,6 +602,8 @@ class Server {
602
602
  let json
603
603
  let js
604
604
 
605
+ console.log("filepath", filepath)
606
+
605
607
  if (filepath.endsWith(".json")) {
606
608
  try {
607
609
  json = (await this.kernel.loader.load(filepath)).resolved
@@ -895,8 +897,11 @@ class Server {
895
897
  let referer = req.get("Referer")
896
898
 
897
899
  let prev = null
898
- if (/\/env\/api\/.+/.test(new URL(referer).pathname)) {
899
- prev = referer
900
+ try {
901
+ if (/\/env\/api\/.+/.test(new URL(referer).pathname)) {
902
+ prev = referer
903
+ }
904
+ } catch (e) {
900
905
  }
901
906
 
902
907
 
@@ -2635,6 +2640,7 @@ class Server {
2635
2640
  }
2636
2641
  }))
2637
2642
  this.app.get("/api/*", ex(async (req, res) => {
2643
+ console.log("req.params", req.params)
2638
2644
  let pathComponents = req.params[0].split("/")
2639
2645
  if (req.query && 'fs' in req.query) {
2640
2646
  // open in file system
@@ -2647,6 +2653,7 @@ class Server {
2647
2653
  try {
2648
2654
  await this.render(req, res, pathComponents)
2649
2655
  } catch (e) {
2656
+ console.log("ERROR", e)
2650
2657
  res.status(404).send(e.message)
2651
2658
  }
2652
2659
  }