hono 3.0.3 → 3.0.5

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.
package/README.md CHANGED
@@ -97,6 +97,8 @@ Thanks to [all contributors](https://github.com/honojs/hono/graphs/contributors)
97
97
 
98
98
  Yusuke Wada <https://github.com/yusukebe>
99
99
 
100
+ "RegExpRouter" and "SmartRouter" are created by Taku Amano <https://github.com/usualoma>
101
+
100
102
  ## License
101
103
 
102
104
  Distributed under the MIT License. See [LICENSE](LICENSE) for more information.
@@ -34,7 +34,10 @@ const etag = (options = { weak: false }) => {
34
34
  await clone.blob();
35
35
  c.res = new Response(null, {
36
36
  status: 304,
37
- statusText: "Not Modified"
37
+ statusText: "Not Modified",
38
+ headers: {
39
+ ETag: etag2
40
+ }
38
41
  });
39
42
  c.res.headers.delete("Content-Length");
40
43
  } else {
@@ -120,12 +120,12 @@ const mergePath = (...paths) => {
120
120
  return p;
121
121
  };
122
122
  const checkOptionalParameter = (path) => {
123
- const match = path.match(/(^.+)(\/\:[^\/]+)\?$/);
123
+ const match = path.match(/^(.+|)(\/\:[^\/]+)\?$/);
124
124
  if (!match)
125
125
  return null;
126
126
  const base = match[1];
127
127
  const optional = base + match[2];
128
- return [base, optional];
128
+ return [base === "" ? "/" : base.replace(/\/$/, ""), optional];
129
129
  };
130
130
  const removeFragment = (queryString) => {
131
131
  const fragIndex = queryString.indexOf("#");
@@ -12,7 +12,10 @@ var etag = (options = { weak: false }) => {
12
12
  await clone.blob();
13
13
  c.res = new Response(null, {
14
14
  status: 304,
15
- statusText: "Not Modified"
15
+ statusText: "Not Modified",
16
+ headers: {
17
+ ETag: etag2
18
+ }
16
19
  });
17
20
  c.res.headers.delete("Content-Length");
18
21
  } else {
package/dist/utils/url.js CHANGED
@@ -90,12 +90,12 @@ var mergePath = (...paths) => {
90
90
  return p;
91
91
  };
92
92
  var checkOptionalParameter = (path) => {
93
- const match = path.match(/(^.+)(\/\:[^\/]+)\?$/);
93
+ const match = path.match(/^(.+|)(\/\:[^\/]+)\?$/);
94
94
  if (!match)
95
95
  return null;
96
96
  const base = match[1];
97
97
  const optional = base + match[2];
98
- return [base, optional];
98
+ return [base === "" ? "/" : base.replace(/\/$/, ""), optional];
99
99
  };
100
100
  var removeFragment = (queryString) => {
101
101
  const fragIndex = queryString.indexOf("#");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "description": "Ultrafast web framework for the Edge",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",