hono 3.2.5 → 3.2.6

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.
@@ -24,7 +24,7 @@ module.exports = __toCommonJS(body_exports);
24
24
  async function parseBody(r) {
25
25
  let body = {};
26
26
  const contentType = r.headers.get("Content-Type");
27
- if (contentType && (contentType.startsWith("multipart/form-data") || contentType === "application/x-www-form-urlencoded")) {
27
+ if (contentType && (contentType.startsWith("multipart/form-data") || contentType.startsWith("application/x-www-form-urlencoded"))) {
28
28
  const form = {};
29
29
  (await r.formData()).forEach((value, key) => {
30
30
  form[key] = value;
@@ -35,7 +35,7 @@ const parse = (cookie) => {
35
35
  const serialize = (name, value, opt = {}) => {
36
36
  value = encodeURIComponent(value);
37
37
  let cookie = `${name}=${value}`;
38
- if (opt.maxAge) {
38
+ if (opt.maxAge && opt.maxAge >= 0) {
39
39
  cookie += `; Max-Age=${Math.floor(opt.maxAge)}`;
40
40
  }
41
41
  if (opt.domain) {
@@ -2,7 +2,7 @@
2
2
  async function parseBody(r) {
3
3
  let body = {};
4
4
  const contentType = r.headers.get("Content-Type");
5
- if (contentType && (contentType.startsWith("multipart/form-data") || contentType === "application/x-www-form-urlencoded")) {
5
+ if (contentType && (contentType.startsWith("multipart/form-data") || contentType.startsWith("application/x-www-form-urlencoded"))) {
6
6
  const form = {};
7
7
  (await r.formData()).forEach((value, key) => {
8
8
  form[key] = value;
@@ -12,7 +12,7 @@ var parse = (cookie) => {
12
12
  var serialize = (name, value, opt = {}) => {
13
13
  value = encodeURIComponent(value);
14
14
  let cookie = `${name}=${value}`;
15
- if (opt.maxAge) {
15
+ if (opt.maxAge && opt.maxAge >= 0) {
16
16
  cookie += `; Max-Age=${Math.floor(opt.maxAge)}`;
17
17
  }
18
18
  if (opt.domain) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "3.2.5",
3
+ "version": "3.2.6",
4
4
  "description": "Ultrafast web framework for the Edges",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",