@depup/hono 4.13.8-depup.0 → 4.13.9-depup.0

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
@@ -13,8 +13,8 @@ npm install @depup/hono
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [hono](https://www.npmjs.com/package/hono) @ 4.13.8 |
17
- | Processed | 2026-09-15 |
16
+ | Original | [hono](https://www.npmjs.com/package/hono) @ 4.13.9 |
17
+ | Processed | 2026-09-24 |
18
18
  | Smoke test | passed |
19
19
  | Deps updated | 0 |
20
20
 
package/changes.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "bumped": {},
3
- "timestamp": "2026-09-15T08:13:39.969Z",
3
+ "timestamp": "2026-09-24T08:12:48.055Z",
4
4
  "totalUpdated": 0
5
5
  }
@@ -202,7 +202,7 @@ var EventV1Processor = class extends EventProcessor {
202
202
  ([key, values]) => values.map((value) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&")
203
203
  ).join("&");
204
204
  } else {
205
- return Object.entries(event.queryStringParameters || {}).filter(([, value]) => value).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value || "")}`).join("&");
205
+ return Object.entries(event.queryStringParameters || {}).filter(([, value]) => value !== void 0).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value || "")}`).join("&");
206
206
  }
207
207
  }
208
208
  getCookies(_event, _headers) {
@@ -262,7 +262,7 @@ var ALBProcessor = class extends EventProcessor {
262
262
  if (event.multiValueQueryStringParameters) {
263
263
  return Object.entries(event.multiValueQueryStringParameters || {}).filter(([, value]) => value).map(([key, value]) => `${key}=${value.join(`&${key}=`)}`).join("&");
264
264
  } else {
265
- return Object.entries(event.queryStringParameters || {}).filter(([, value]) => value).map(([key, value]) => `${key}=${value}`).join("&");
265
+ return Object.entries(event.queryStringParameters || {}).filter(([, value]) => value !== void 0).map(([key, value]) => `${key}=${value}`).join("&");
266
266
  }
267
267
  }
268
268
  getCookies(event, headers) {
@@ -344,7 +344,10 @@ var isLatticeEventV2 = (event) => {
344
344
  return false;
345
345
  };
346
346
  var defaultIsContentTypeBinary = (contentType) => {
347
- return !/^text\/(?:plain|html|css|javascript|csv)|(?:\/|\+)(?:json|xml)\s*(?:;|$)/.test(
347
+ if (/^application\/vnd\.(?:apple\.installer|mozilla\.xul)\+xml\s*(?:;|$)/i.test(contentType)) {
348
+ return true;
349
+ }
350
+ return !/^text\/(?:plain|html|css|javascript|csv)|(?:\/|\+)(?:json|xml)\s*(?:;|$)/i.test(
348
351
  contentType
349
352
  );
350
353
  };
@@ -17,7 +17,8 @@ var handle = (app) => {
17
17
  const [context, callback] = args;
18
18
  let callbackError = null;
19
19
  let callbackResult;
20
- const res = await app.fetch(createRequest(event), {
20
+ const cf = getCloudFrontRecord(event);
21
+ const res = await app.fetch(createRequest(cf), {
21
22
  event,
22
23
  context,
23
24
  callback: (err, result) => {
@@ -27,9 +28,9 @@ var handle = (app) => {
27
28
  }
28
29
  callback?.(err, result);
29
30
  },
30
- config: event.Records[0].cf.config,
31
- request: event.Records[0].cf.request,
32
- response: event.Records[0].cf.response
31
+ config: cf.config,
32
+ request: cf.request,
33
+ response: cf.response
33
34
  });
34
35
  if (callbackError) {
35
36
  throw callbackError;
@@ -48,17 +49,27 @@ var createResult = async (res) => {
48
49
  ...isBase64Encoded && { bodyEncoding: "base64" }
49
50
  };
50
51
  };
51
- var createRequest = (event) => {
52
- const queryString = event.Records[0].cf.request.querystring;
53
- const host = event.Records[0].cf.request.headers?.host?.[0]?.value || event.Records[0].cf.config.distributionDomainName;
54
- const urlPath = `https://${host}${event.Records[0].cf.request.uri}`;
52
+ var getCloudFrontRecord = (event) => {
53
+ const cf = event?.Records?.[0]?.cf;
54
+ if (!cf?.request) {
55
+ throw new TypeError(
56
+ "Unable to map the CloudFront event to a Request: expected `Records[0].cf.request` in the Lambda@Edge event."
57
+ );
58
+ }
59
+ return cf;
60
+ };
61
+ var createRequest = (cf) => {
62
+ const request = cf.request;
63
+ const queryString = request.querystring;
64
+ const host = request.headers?.host?.[0]?.value || cf.config?.distributionDomainName;
65
+ const urlPath = `https://${host}${request.uri}`;
55
66
  const url = queryString ? `${urlPath}?${queryString}` : urlPath;
56
67
  const headers = new Headers();
57
- Object.entries(event.Records[0].cf.request.headers).forEach(([k, v]) => {
68
+ Object.entries(request.headers ?? {}).forEach(([k, v]) => {
58
69
  v.forEach((header) => headers.append(k, header.value));
59
70
  });
60
- const requestBody = event.Records[0].cf.request.body;
61
- const method = event.Records[0].cf.request.method;
71
+ const requestBody = request.body;
72
+ const method = request.method;
62
73
  const rawBody = createBody(method, requestBody);
63
74
  let body = rawBody;
64
75
  if (rawBody !== void 0) {
@@ -85,7 +96,10 @@ var createBody = (method, requestBody) => {
85
96
  return requestBody.data;
86
97
  };
87
98
  var isContentTypeBinary = (contentType) => {
88
- return !/^(text\/(plain|html|css|javascript|csv).*|application\/(.*json|.*xml).*|image\/svg\+xml.*)$/.test(
99
+ if (/^application\/vnd\.(?:apple\.installer|mozilla\.xul)\+xml\s*(?:;|$)/i.test(contentType)) {
100
+ return true;
101
+ }
102
+ return !/^text\/(?:plain|html|css|javascript|csv)|(?:\/|\+)(?:json|xml)\s*(?:;|$)/i.test(
89
103
  contentType
90
104
  );
91
105
  };
@@ -232,7 +232,7 @@ class EventV1Processor extends EventProcessor {
232
232
  ([key, values]) => values.map((value) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&")
233
233
  ).join("&");
234
234
  } else {
235
- return Object.entries(event.queryStringParameters || {}).filter(([, value]) => value).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value || "")}`).join("&");
235
+ return Object.entries(event.queryStringParameters || {}).filter(([, value]) => value !== void 0).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value || "")}`).join("&");
236
236
  }
237
237
  }
238
238
  getCookies(_event, _headers) {
@@ -292,7 +292,7 @@ class ALBProcessor extends EventProcessor {
292
292
  if (event.multiValueQueryStringParameters) {
293
293
  return Object.entries(event.multiValueQueryStringParameters || {}).filter(([, value]) => value).map(([key, value]) => `${key}=${value.join(`&${key}=`)}`).join("&");
294
294
  } else {
295
- return Object.entries(event.queryStringParameters || {}).filter(([, value]) => value).map(([key, value]) => `${key}=${value}`).join("&");
295
+ return Object.entries(event.queryStringParameters || {}).filter(([, value]) => value !== void 0).map(([key, value]) => `${key}=${value}`).join("&");
296
296
  }
297
297
  }
298
298
  getCookies(event, headers) {
@@ -374,7 +374,10 @@ const isLatticeEventV2 = (event) => {
374
374
  return false;
375
375
  };
376
376
  const defaultIsContentTypeBinary = (contentType) => {
377
- return !/^text\/(?:plain|html|css|javascript|csv)|(?:\/|\+)(?:json|xml)\s*(?:;|$)/.test(
377
+ if (/^application\/vnd\.(?:apple\.installer|mozilla\.xul)\+xml\s*(?:;|$)/i.test(contentType)) {
378
+ return true;
379
+ }
380
+ return !/^text\/(?:plain|html|css|javascript|csv)|(?:\/|\+)(?:json|xml)\s*(?:;|$)/i.test(
378
381
  contentType
379
382
  );
380
383
  };
@@ -50,7 +50,8 @@ const handle = (app) => {
50
50
  const [context, callback] = args;
51
51
  let callbackError = null;
52
52
  let callbackResult;
53
- const res = await app.fetch(createRequest(event), {
53
+ const cf = getCloudFrontRecord(event);
54
+ const res = await app.fetch(createRequest(cf), {
54
55
  event,
55
56
  context,
56
57
  callback: (err, result) => {
@@ -60,9 +61,9 @@ const handle = (app) => {
60
61
  }
61
62
  callback?.(err, result);
62
63
  },
63
- config: event.Records[0].cf.config,
64
- request: event.Records[0].cf.request,
65
- response: event.Records[0].cf.response
64
+ config: cf.config,
65
+ request: cf.request,
66
+ response: cf.response
66
67
  });
67
68
  if (callbackError) {
68
69
  throw callbackError;
@@ -81,17 +82,27 @@ const createResult = async (res) => {
81
82
  ...isBase64Encoded && { bodyEncoding: "base64" }
82
83
  };
83
84
  };
84
- const createRequest = (event) => {
85
- const queryString = event.Records[0].cf.request.querystring;
86
- const host = event.Records[0].cf.request.headers?.host?.[0]?.value || event.Records[0].cf.config.distributionDomainName;
87
- const urlPath = `https://${host}${event.Records[0].cf.request.uri}`;
85
+ const getCloudFrontRecord = (event) => {
86
+ const cf = event?.Records?.[0]?.cf;
87
+ if (!cf?.request) {
88
+ throw new TypeError(
89
+ "Unable to map the CloudFront event to a Request: expected `Records[0].cf.request` in the Lambda@Edge event."
90
+ );
91
+ }
92
+ return cf;
93
+ };
94
+ const createRequest = (cf) => {
95
+ const request = cf.request;
96
+ const queryString = request.querystring;
97
+ const host = request.headers?.host?.[0]?.value || cf.config?.distributionDomainName;
98
+ const urlPath = `https://${host}${request.uri}`;
88
99
  const url = queryString ? `${urlPath}?${queryString}` : urlPath;
89
100
  const headers = new Headers();
90
- Object.entries(event.Records[0].cf.request.headers).forEach(([k, v]) => {
101
+ Object.entries(request.headers ?? {}).forEach(([k, v]) => {
91
102
  v.forEach((header) => headers.append(k, header.value));
92
103
  });
93
- const requestBody = event.Records[0].cf.request.body;
94
- const method = event.Records[0].cf.request.method;
104
+ const requestBody = request.body;
105
+ const method = request.method;
95
106
  const rawBody = createBody(method, requestBody);
96
107
  let body = rawBody;
97
108
  if (rawBody !== void 0) {
@@ -118,7 +129,10 @@ const createBody = (method, requestBody) => {
118
129
  return requestBody.data;
119
130
  };
120
131
  const isContentTypeBinary = (contentType) => {
121
- return !/^(text\/(plain|html|css|javascript|csv).*|application\/(.*json|.*xml).*|image\/svg\+xml.*)$/.test(
132
+ if (/^application\/vnd\.(?:apple\.installer|mozilla\.xul)\+xml\s*(?:;|$)/i.test(contentType)) {
133
+ return true;
134
+ }
135
+ return !/^text\/(?:plain|html|css|javascript|csv)|(?:\/|\+)(?:json|xml)\s*(?:;|$)/i.test(
122
136
  contentType
123
137
  );
124
138
  };
@@ -23,15 +23,17 @@ __export(accepts_exports, {
23
23
  module.exports = __toCommonJS(accepts_exports);
24
24
  var import_accept = require("../../utils/accept");
25
25
  const matchType = (acceptType, supportedType) => {
26
- if (acceptType === supportedType) {
26
+ const accept = acceptType.toLowerCase();
27
+ const supported = supportedType.toLowerCase();
28
+ if (accept === supported) {
27
29
  return true;
28
30
  }
29
- if (acceptType === "*/*" || acceptType === "*") {
31
+ if (accept === "*/*" || accept === "*") {
30
32
  return false;
31
33
  }
32
- if (acceptType.endsWith("/*")) {
33
- const [acceptMain] = acceptType.split("/");
34
- const [supportedMain] = supportedType.split("/");
34
+ if (accept.endsWith("/*")) {
35
+ const [acceptMain] = accept.split("/");
36
+ const [supportedMain] = supported.split("/");
35
37
  return acceptMain === supportedMain;
36
38
  }
37
39
  return false;
@@ -110,7 +110,7 @@ const ErrorBoundary = async ({ children, fallback, fallbackRender, onError }) =>
110
110
  if (resArray.some((res) => res instanceof Promise)) {
111
111
  getResume();
112
112
  const index = errorBoundaryCounter++;
113
- const replaceRe = RegExp(`(<template id="E:${index}"></template>.*?)(.*?)(<!--E:${index}-->)`);
113
+ const replaceRe = RegExp(`(<template id="E:${index}"></template>)(.*?)(<!--E:${index}-->)`, "s");
114
114
  let caught = false;
115
115
  const catchCallback = async ({ error: error2, buffer }) => {
116
116
  if (caught) {
@@ -82,7 +82,7 @@ const Suspense = async ({
82
82
  const content = htmlArray.join("");
83
83
  if (buffer) {
84
84
  buffer[0] = buffer[0].replace(
85
- new RegExp(`<template id="H:${index}"></template>.*?<!--/\\$-->`),
85
+ new RegExp(`<template id="H:${index}"></template>.*?<!--/\\$-->`, "s"),
86
86
  () => content
87
87
  );
88
88
  }
@@ -28,8 +28,14 @@ const prettyJSON = (options) => {
28
28
  await next();
29
29
  const contentType = c.res.headers.get("Content-Type");
30
30
  if (pretty && contentType && jsonContentTypeRegex.test(contentType)) {
31
- const obj = await c.res.json();
31
+ let obj;
32
+ try {
33
+ obj = await c.res.clone().json();
34
+ } catch {
35
+ return;
36
+ }
32
37
  c.res = new Response(JSON.stringify(obj, null, options?.space ?? 2), c.res);
38
+ c.res.headers.delete("Content-Length");
33
39
  }
34
40
  };
35
41
  };
@@ -108,11 +108,11 @@ class LinearRouter {
108
108
  } else {
109
109
  let endValuePos = path.indexOf("/", pos + 1);
110
110
  if (endValuePos === -1) {
111
- if (pos + 1 === path.length) {
112
- continue ROUTES_LOOP;
113
- }
114
111
  endValuePos = path.length;
115
112
  }
113
+ if (endValuePos === pos + 1) {
114
+ continue ROUTES_LOOP;
115
+ }
116
116
  value = path.slice(pos + 1, endValuePos);
117
117
  pos = endValuePos;
118
118
  }
@@ -120,12 +120,13 @@ const verify = async (token, publicKey, algOrOptions) => {
120
120
  }
121
121
  }
122
122
  const headerPayload = token.substring(0, token.lastIndexOf("."));
123
- const verified = await (0, import_jws.verifying)(
124
- publicKey,
125
- alg,
126
- (0, import_encode.decodeBase64Url)(tokenParts[2]),
127
- import_utf8.utf8Encoder.encode(headerPayload)
128
- );
123
+ let signature;
124
+ try {
125
+ signature = (0, import_encode.decodeBase64Url)(tokenParts[2]);
126
+ } catch {
127
+ throw new import_types.JwtTokenInvalid(token);
128
+ }
129
+ const verified = await (0, import_jws.verifying)(publicKey, alg, signature, import_utf8.utf8Encoder.encode(headerPayload));
129
130
  if (!verified) {
130
131
  throw new import_types.JwtTokenSignatureMismatched(token);
131
132
  }
@@ -1,15 +1,17 @@
1
1
  // src/helper/accepts/accepts.ts
2
2
  import { parseAccept } from "../../utils/accept.js";
3
3
  var matchType = (acceptType, supportedType) => {
4
- if (acceptType === supportedType) {
4
+ const accept = acceptType.toLowerCase();
5
+ const supported = supportedType.toLowerCase();
6
+ if (accept === supported) {
5
7
  return true;
6
8
  }
7
- if (acceptType === "*/*" || acceptType === "*") {
9
+ if (accept === "*/*" || accept === "*") {
8
10
  return false;
9
11
  }
10
- if (acceptType.endsWith("/*")) {
11
- const [acceptMain] = acceptType.split("/");
12
- const [supportedMain] = supportedType.split("/");
12
+ if (accept.endsWith("/*")) {
13
+ const [acceptMain] = accept.split("/");
14
+ const [supportedMain] = supported.split("/");
13
15
  return acceptMain === supportedMain;
14
16
  }
15
17
  return false;
@@ -88,7 +88,7 @@ var ErrorBoundary = async ({ children, fallback, fallbackRender, onError }) => {
88
88
  if (resArray.some((res) => res instanceof Promise)) {
89
89
  getResume();
90
90
  const index = errorBoundaryCounter++;
91
- const replaceRe = RegExp(`(<template id="E:${index}"></template>.*?)(.*?)(<!--E:${index}-->)`);
91
+ const replaceRe = RegExp(`(<template id="E:${index}"></template>)(.*?)(<!--E:${index}-->)`, "s");
92
92
  let caught = false;
93
93
  const catchCallback = async ({ error: error2, buffer }) => {
94
94
  if (caught) {
@@ -59,7 +59,7 @@ var Suspense = async ({
59
59
  const content = htmlArray.join("");
60
60
  if (buffer) {
61
61
  buffer[0] = buffer[0].replace(
62
- new RegExp(`<template id="H:${index}"></template>.*?<!--/\\$-->`),
62
+ new RegExp(`<template id="H:${index}"></template>.*?<!--/\\$-->`, "s"),
63
63
  () => content
64
64
  );
65
65
  }
@@ -7,8 +7,14 @@ var prettyJSON = (options) => {
7
7
  await next();
8
8
  const contentType = c.res.headers.get("Content-Type");
9
9
  if (pretty && contentType && jsonContentTypeRegex.test(contentType)) {
10
- const obj = await c.res.json();
10
+ let obj;
11
+ try {
12
+ obj = await c.res.clone().json();
13
+ } catch {
14
+ return;
15
+ }
11
16
  c.res = new Response(JSON.stringify(obj, null, options?.space ?? 2), c.res);
17
+ c.res.headers.delete("Content-Length");
12
18
  }
13
19
  };
14
20
  };
@@ -87,11 +87,11 @@ var LinearRouter = class {
87
87
  } else {
88
88
  let endValuePos = path.indexOf("/", pos + 1);
89
89
  if (endValuePos === -1) {
90
- if (pos + 1 === path.length) {
91
- continue ROUTES_LOOP;
92
- }
93
90
  endValuePos = path.length;
94
91
  }
92
+ if (endValuePos === pos + 1) {
93
+ continue ROUTES_LOOP;
94
+ }
95
95
  value = path.slice(pos + 1, endValuePos);
96
96
  pos = endValuePos;
97
97
  }
@@ -109,12 +109,13 @@ var verify = async (token, publicKey, algOrOptions) => {
109
109
  }
110
110
  }
111
111
  const headerPayload = token.substring(0, token.lastIndexOf("."));
112
- const verified = await verifying(
113
- publicKey,
114
- alg,
115
- decodeBase64Url(tokenParts[2]),
116
- utf8Encoder.encode(headerPayload)
117
- );
112
+ let signature;
113
+ try {
114
+ signature = decodeBase64Url(tokenParts[2]);
115
+ } catch {
116
+ throw new JwtTokenInvalid(token);
117
+ }
118
+ const verified = await verifying(publicKey, alg, signature, utf8Encoder.encode(headerPayload));
118
119
  if (!verified) {
119
120
  throw new JwtTokenSignatureMismatched(token);
120
121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depup/hono",
3
- "version": "4.13.8-depup.0",
3
+ "version": "4.13.9-depup.0",
4
4
  "description": "Web framework built on Web Standards (with updated dependencies)",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",
@@ -711,8 +711,8 @@
711
711
  "changes": {},
712
712
  "depsUpdated": 0,
713
713
  "originalPackage": "hono",
714
- "originalVersion": "4.13.8",
715
- "processedAt": "2026-09-15T08:13:57.753Z",
714
+ "originalVersion": "4.13.9",
715
+ "processedAt": "2026-09-24T08:13:10.881Z",
716
716
  "smokeTest": "passed"
717
717
  }
718
718
  }