hono 4.12.33 → 4.12.34
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/dist/cjs/helper/proxy/index.js +4 -0
- package/dist/cjs/jsx/base.js +1 -9
- package/dist/cjs/middleware/cors/index.js +1 -1
- package/dist/cjs/middleware/language/language.js +10 -6
- package/dist/helper/proxy/index.js +4 -0
- package/dist/jsx/base.js +1 -9
- package/dist/middleware/cors/index.js +1 -1
- package/dist/middleware/language/language.js +10 -6
- package/package.json +1 -1
|
@@ -92,6 +92,10 @@ const proxy = async (input, proxyInit) => {
|
|
|
92
92
|
req.headers.delete("accept-encoding");
|
|
93
93
|
const res = await (customFetch || fetch)(req);
|
|
94
94
|
const resHeaders = new Headers(res.headers);
|
|
95
|
+
const connectionValue = resHeaders.get("connection");
|
|
96
|
+
if (connectionValue) {
|
|
97
|
+
connectionValue.split(",").map((h) => h.trim()).filter((h) => ALLOWED_TOKEN_PATTERN.test(h)).forEach((h) => resHeaders.delete(h));
|
|
98
|
+
}
|
|
95
99
|
hopByHopHeaders.forEach((header) => {
|
|
96
100
|
resHeaders.delete(header);
|
|
97
101
|
});
|
package/dist/cjs/jsx/base.js
CHANGED
|
@@ -315,15 +315,7 @@ const shallowEqual = (a, b) => {
|
|
|
315
315
|
return true;
|
|
316
316
|
};
|
|
317
317
|
const memo = (component, propsAreEqual = shallowEqual) => {
|
|
318
|
-
|
|
319
|
-
let prevProps = void 0;
|
|
320
|
-
const wrapper = ((props) => {
|
|
321
|
-
if (prevProps && !propsAreEqual(prevProps, props)) {
|
|
322
|
-
computed = null;
|
|
323
|
-
}
|
|
324
|
-
prevProps = props;
|
|
325
|
-
return computed ||= component(props);
|
|
326
|
-
});
|
|
318
|
+
const wrapper = ((props) => component(props));
|
|
327
319
|
wrapper[import_constants.DOM_MEMO] = propsAreEqual;
|
|
328
320
|
wrapper[import_constants.DOM_RENDERER] = component;
|
|
329
321
|
return wrapper;
|
|
@@ -79,7 +79,7 @@ const cors = (options) => {
|
|
|
79
79
|
if (!headers?.length) {
|
|
80
80
|
const requestHeaders = c.req.header("Access-Control-Request-Headers");
|
|
81
81
|
if (requestHeaders) {
|
|
82
|
-
headers = requestHeaders.split(
|
|
82
|
+
headers = requestHeaders.split(",").map((h) => h.trim());
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
if (headers?.length) {
|
|
@@ -69,14 +69,18 @@ const normalizeLanguage = (lang, options) => {
|
|
|
69
69
|
if (exactIndex !== -1) {
|
|
70
70
|
return options.supportedLanguages[exactIndex];
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
|
|
72
|
+
let longestMatchIndex = -1;
|
|
73
|
+
let longestMatchLength = -1;
|
|
74
|
+
for (let i = 0; i < compSupported.length; i++) {
|
|
75
|
+
const candidate = compSupported[i];
|
|
76
|
+
if (candidate.length < compLang.length && candidate.length > longestMatchLength && compLang.startsWith(candidate) && compLang[candidate.length] === "-") {
|
|
77
|
+
longestMatchIndex = i;
|
|
78
|
+
longestMatchLength = candidate.length;
|
|
78
79
|
}
|
|
79
80
|
}
|
|
81
|
+
if (longestMatchIndex !== -1) {
|
|
82
|
+
return options.supportedLanguages[longestMatchIndex];
|
|
83
|
+
}
|
|
80
84
|
return void 0;
|
|
81
85
|
} catch {
|
|
82
86
|
return void 0;
|
|
@@ -71,6 +71,10 @@ var proxy = async (input, proxyInit) => {
|
|
|
71
71
|
req.headers.delete("accept-encoding");
|
|
72
72
|
const res = await (customFetch || fetch)(req);
|
|
73
73
|
const resHeaders = new Headers(res.headers);
|
|
74
|
+
const connectionValue = resHeaders.get("connection");
|
|
75
|
+
if (connectionValue) {
|
|
76
|
+
connectionValue.split(",").map((h) => h.trim()).filter((h) => ALLOWED_TOKEN_PATTERN.test(h)).forEach((h) => resHeaders.delete(h));
|
|
77
|
+
}
|
|
74
78
|
hopByHopHeaders.forEach((header) => {
|
|
75
79
|
resHeaders.delete(header);
|
|
76
80
|
});
|
package/dist/jsx/base.js
CHANGED
|
@@ -284,15 +284,7 @@ var shallowEqual = (a, b) => {
|
|
|
284
284
|
return true;
|
|
285
285
|
};
|
|
286
286
|
var memo = (component, propsAreEqual = shallowEqual) => {
|
|
287
|
-
|
|
288
|
-
let prevProps = void 0;
|
|
289
|
-
const wrapper = ((props) => {
|
|
290
|
-
if (prevProps && !propsAreEqual(prevProps, props)) {
|
|
291
|
-
computed = null;
|
|
292
|
-
}
|
|
293
|
-
prevProps = props;
|
|
294
|
-
return computed ||= component(props);
|
|
295
|
-
});
|
|
287
|
+
const wrapper = ((props) => component(props));
|
|
296
288
|
wrapper[DOM_MEMO] = propsAreEqual;
|
|
297
289
|
wrapper[DOM_RENDERER] = component;
|
|
298
290
|
return wrapper;
|
|
@@ -58,7 +58,7 @@ var cors = (options) => {
|
|
|
58
58
|
if (!headers?.length) {
|
|
59
59
|
const requestHeaders = c.req.header("Access-Control-Request-Headers");
|
|
60
60
|
if (requestHeaders) {
|
|
61
|
-
headers = requestHeaders.split(
|
|
61
|
+
headers = requestHeaders.split(",").map((h) => h.trim());
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
if (headers?.length) {
|
|
@@ -39,14 +39,18 @@ var normalizeLanguage = (lang, options) => {
|
|
|
39
39
|
if (exactIndex !== -1) {
|
|
40
40
|
return options.supportedLanguages[exactIndex];
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
|
|
42
|
+
let longestMatchIndex = -1;
|
|
43
|
+
let longestMatchLength = -1;
|
|
44
|
+
for (let i = 0; i < compSupported.length; i++) {
|
|
45
|
+
const candidate = compSupported[i];
|
|
46
|
+
if (candidate.length < compLang.length && candidate.length > longestMatchLength && compLang.startsWith(candidate) && compLang[candidate.length] === "-") {
|
|
47
|
+
longestMatchIndex = i;
|
|
48
|
+
longestMatchLength = candidate.length;
|
|
48
49
|
}
|
|
49
50
|
}
|
|
51
|
+
if (longestMatchIndex !== -1) {
|
|
52
|
+
return options.supportedLanguages[longestMatchIndex];
|
|
53
|
+
}
|
|
50
54
|
return void 0;
|
|
51
55
|
} catch {
|
|
52
56
|
return void 0;
|