hono 3.9.1 → 3.9.2

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.
@@ -23,7 +23,7 @@ __export(filepath_exports, {
23
23
  module.exports = __toCommonJS(filepath_exports);
24
24
  const getFilePath = (options) => {
25
25
  let filename = options.filename;
26
- if (/(?:^|\/)\.\.(?:$|\/)/.test(filename))
26
+ if (/(?:^|[\/\\])\.\.(?:$|[\/\\])/.test(filename))
27
27
  return;
28
28
  let root = options.root || "";
29
29
  const defaultDocument = options.defaultDocument || "index.html";
@@ -32,7 +32,8 @@ const getFilePath = (options) => {
32
32
  } else if (!filename.match(/\.[a-zA-Z0-9]+$/)) {
33
33
  filename = filename.concat("/" + defaultDocument);
34
34
  }
35
- filename = filename.replace(/^\.?\//, "");
35
+ filename = filename.replace(/^\.?[\/\\]/, "");
36
+ filename = filename.replace(/\\/, "/");
36
37
  root = root.replace(/\/$/, "");
37
38
  let path = root ? root + "/" + filename : filename;
38
39
  path = path.replace(/^\.?\//, "");
@@ -1,7 +1,7 @@
1
1
  // src/utils/filepath.ts
2
2
  var getFilePath = (options) => {
3
3
  let filename = options.filename;
4
- if (/(?:^|\/)\.\.(?:$|\/)/.test(filename))
4
+ if (/(?:^|[\/\\])\.\.(?:$|[\/\\])/.test(filename))
5
5
  return;
6
6
  let root = options.root || "";
7
7
  const defaultDocument = options.defaultDocument || "index.html";
@@ -10,7 +10,8 @@ var getFilePath = (options) => {
10
10
  } else if (!filename.match(/\.[a-zA-Z0-9]+$/)) {
11
11
  filename = filename.concat("/" + defaultDocument);
12
12
  }
13
- filename = filename.replace(/^\.?\//, "");
13
+ filename = filename.replace(/^\.?[\/\\]/, "");
14
+ filename = filename.replace(/\\/, "/");
14
15
  root = root.replace(/\/$/, "");
15
16
  let path = root ? root + "/" + filename : filename;
16
17
  path = path.replace(/^\.?\//, "");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "3.9.1",
3
+ "version": "3.9.2",
4
4
  "description": "Ultrafast web framework for the Edges",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",