@hono/node-server 1.19.8 → 1.19.10
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/LICENSE +21 -0
- package/README.md +4 -3
- package/dist/globals.js +0 -10
- package/dist/globals.mjs +0 -10
- package/dist/index.js +0 -10
- package/dist/index.mjs +0 -10
- package/dist/listener.js +0 -10
- package/dist/listener.mjs +0 -10
- package/dist/serve-static.js +15 -1
- package/dist/serve-static.mjs +15 -1
- package/dist/server.js +0 -10
- package/dist/server.mjs +0 -10
- package/dist/vercel.js +0 -10
- package/dist/vercel.mjs +0 -10
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 - present, Yusuke Wada and Hono contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -335,7 +335,7 @@ import { createAdaptorServer } from '@hono/node-server'
|
|
|
335
335
|
|
|
336
336
|
// ...
|
|
337
337
|
|
|
338
|
-
const socketPath ='/tmp/example.sock'
|
|
338
|
+
const socketPath = '/tmp/example.sock'
|
|
339
339
|
|
|
340
340
|
const server = createAdaptorServer(app)
|
|
341
341
|
server.listen(socketPath, () => {
|
|
@@ -348,9 +348,10 @@ server.listen(socketPath, () => {
|
|
|
348
348
|
- Hono - <https://hono.dev>
|
|
349
349
|
- Hono GitHub repository - <https://github.com/honojs/hono>
|
|
350
350
|
|
|
351
|
-
##
|
|
351
|
+
## Authors
|
|
352
352
|
|
|
353
|
-
Yusuke Wada <https://github.com/yusukebe>
|
|
353
|
+
- Yusuke Wada <https://github.com/yusukebe>
|
|
354
|
+
- Taku Amano <https://github.com/usualoma>
|
|
354
355
|
|
|
355
356
|
## License
|
|
356
357
|
|
package/dist/globals.js
CHANGED
|
@@ -24,16 +24,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
|
|
25
25
|
// src/globals.ts
|
|
26
26
|
var import_node_crypto = __toESM(require("crypto"));
|
|
27
|
-
var webFetch = global.fetch;
|
|
28
27
|
if (typeof global.crypto === "undefined") {
|
|
29
28
|
global.crypto = import_node_crypto.default;
|
|
30
29
|
}
|
|
31
|
-
global.fetch = (info, init) => {
|
|
32
|
-
init = {
|
|
33
|
-
// Disable compression handling so people can return the result of a fetch
|
|
34
|
-
// directly in the loader without messing with the Content-Encoding header.
|
|
35
|
-
compress: false,
|
|
36
|
-
...init
|
|
37
|
-
};
|
|
38
|
-
return webFetch(info, init);
|
|
39
|
-
};
|
package/dist/globals.mjs
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
// src/globals.ts
|
|
2
2
|
import crypto from "crypto";
|
|
3
|
-
var webFetch = global.fetch;
|
|
4
3
|
if (typeof global.crypto === "undefined") {
|
|
5
4
|
global.crypto = crypto;
|
|
6
5
|
}
|
|
7
|
-
global.fetch = (info, init) => {
|
|
8
|
-
init = {
|
|
9
|
-
// Disable compression handling so people can return the result of a fetch
|
|
10
|
-
// directly in the loader without messing with the Content-Encoding header.
|
|
11
|
-
compress: false,
|
|
12
|
-
...init
|
|
13
|
-
};
|
|
14
|
-
return webFetch(info, init);
|
|
15
|
-
};
|
package/dist/index.js
CHANGED
|
@@ -368,19 +368,9 @@ var X_ALREADY_SENT = "x-hono-already-sent";
|
|
|
368
368
|
|
|
369
369
|
// src/globals.ts
|
|
370
370
|
var import_node_crypto = __toESM(require("crypto"));
|
|
371
|
-
var webFetch = global.fetch;
|
|
372
371
|
if (typeof global.crypto === "undefined") {
|
|
373
372
|
global.crypto = import_node_crypto.default;
|
|
374
373
|
}
|
|
375
|
-
global.fetch = (info, init) => {
|
|
376
|
-
init = {
|
|
377
|
-
// Disable compression handling so people can return the result of a fetch
|
|
378
|
-
// directly in the loader without messing with the Content-Encoding header.
|
|
379
|
-
compress: false,
|
|
380
|
-
...init
|
|
381
|
-
};
|
|
382
|
-
return webFetch(info, init);
|
|
383
|
-
};
|
|
384
374
|
|
|
385
375
|
// src/listener.ts
|
|
386
376
|
var outgoingEnded = Symbol("outgoingEnded");
|
package/dist/index.mjs
CHANGED
|
@@ -329,19 +329,9 @@ var X_ALREADY_SENT = "x-hono-already-sent";
|
|
|
329
329
|
|
|
330
330
|
// src/globals.ts
|
|
331
331
|
import crypto from "crypto";
|
|
332
|
-
var webFetch = global.fetch;
|
|
333
332
|
if (typeof global.crypto === "undefined") {
|
|
334
333
|
global.crypto = crypto;
|
|
335
334
|
}
|
|
336
|
-
global.fetch = (info, init) => {
|
|
337
|
-
init = {
|
|
338
|
-
// Disable compression handling so people can return the result of a fetch
|
|
339
|
-
// directly in the loader without messing with the Content-Encoding header.
|
|
340
|
-
compress: false,
|
|
341
|
-
...init
|
|
342
|
-
};
|
|
343
|
-
return webFetch(info, init);
|
|
344
|
-
};
|
|
345
335
|
|
|
346
336
|
// src/listener.ts
|
|
347
337
|
var outgoingEnded = Symbol("outgoingEnded");
|
package/dist/listener.js
CHANGED
|
@@ -360,19 +360,9 @@ var X_ALREADY_SENT = "x-hono-already-sent";
|
|
|
360
360
|
|
|
361
361
|
// src/globals.ts
|
|
362
362
|
var import_node_crypto = __toESM(require("crypto"));
|
|
363
|
-
var webFetch = global.fetch;
|
|
364
363
|
if (typeof global.crypto === "undefined") {
|
|
365
364
|
global.crypto = import_node_crypto.default;
|
|
366
365
|
}
|
|
367
|
-
global.fetch = (info, init) => {
|
|
368
|
-
init = {
|
|
369
|
-
// Disable compression handling so people can return the result of a fetch
|
|
370
|
-
// directly in the loader without messing with the Content-Encoding header.
|
|
371
|
-
compress: false,
|
|
372
|
-
...init
|
|
373
|
-
};
|
|
374
|
-
return webFetch(info, init);
|
|
375
|
-
};
|
|
376
366
|
|
|
377
367
|
// src/listener.ts
|
|
378
368
|
var outgoingEnded = Symbol("outgoingEnded");
|
package/dist/listener.mjs
CHANGED
|
@@ -326,19 +326,9 @@ var X_ALREADY_SENT = "x-hono-already-sent";
|
|
|
326
326
|
|
|
327
327
|
// src/globals.ts
|
|
328
328
|
import crypto from "crypto";
|
|
329
|
-
var webFetch = global.fetch;
|
|
330
329
|
if (typeof global.crypto === "undefined") {
|
|
331
330
|
global.crypto = crypto;
|
|
332
331
|
}
|
|
333
|
-
global.fetch = (info, init) => {
|
|
334
|
-
init = {
|
|
335
|
-
// Disable compression handling so people can return the result of a fetch
|
|
336
|
-
// directly in the loader without messing with the Content-Encoding header.
|
|
337
|
-
compress: false,
|
|
338
|
-
...init
|
|
339
|
-
};
|
|
340
|
-
return webFetch(info, init);
|
|
341
|
-
};
|
|
342
332
|
|
|
343
333
|
// src/listener.ts
|
|
344
334
|
var outgoingEnded = Symbol("outgoingEnded");
|
package/dist/serve-static.js
CHANGED
|
@@ -70,6 +70,20 @@ var getStats = (path) => {
|
|
|
70
70
|
}
|
|
71
71
|
return stats;
|
|
72
72
|
};
|
|
73
|
+
var tryDecode = (str, decoder) => {
|
|
74
|
+
try {
|
|
75
|
+
return decoder(str);
|
|
76
|
+
} catch {
|
|
77
|
+
return str.replace(/(?:%[0-9A-Fa-f]{2})+/g, (match) => {
|
|
78
|
+
try {
|
|
79
|
+
return decoder(match);
|
|
80
|
+
} catch {
|
|
81
|
+
return match;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
var tryDecodeURI = (str) => tryDecode(str, decodeURI);
|
|
73
87
|
var serveStatic = (options = { root: "" }) => {
|
|
74
88
|
const root = options.root || "";
|
|
75
89
|
const optionPath = options.path;
|
|
@@ -85,7 +99,7 @@ var serveStatic = (options = { root: "" }) => {
|
|
|
85
99
|
filename = optionPath;
|
|
86
100
|
} else {
|
|
87
101
|
try {
|
|
88
|
-
filename =
|
|
102
|
+
filename = tryDecodeURI(c.req.path);
|
|
89
103
|
if (/(?:^|[\/\\])\.\.(?:$|[\/\\])/.test(filename)) {
|
|
90
104
|
throw new Error();
|
|
91
105
|
}
|
package/dist/serve-static.mjs
CHANGED
|
@@ -46,6 +46,20 @@ var getStats = (path) => {
|
|
|
46
46
|
}
|
|
47
47
|
return stats;
|
|
48
48
|
};
|
|
49
|
+
var tryDecode = (str, decoder) => {
|
|
50
|
+
try {
|
|
51
|
+
return decoder(str);
|
|
52
|
+
} catch {
|
|
53
|
+
return str.replace(/(?:%[0-9A-Fa-f]{2})+/g, (match) => {
|
|
54
|
+
try {
|
|
55
|
+
return decoder(match);
|
|
56
|
+
} catch {
|
|
57
|
+
return match;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var tryDecodeURI = (str) => tryDecode(str, decodeURI);
|
|
49
63
|
var serveStatic = (options = { root: "" }) => {
|
|
50
64
|
const root = options.root || "";
|
|
51
65
|
const optionPath = options.path;
|
|
@@ -61,7 +75,7 @@ var serveStatic = (options = { root: "" }) => {
|
|
|
61
75
|
filename = optionPath;
|
|
62
76
|
} else {
|
|
63
77
|
try {
|
|
64
|
-
filename =
|
|
78
|
+
filename = tryDecodeURI(c.req.path);
|
|
65
79
|
if (/(?:^|[\/\\])\.\.(?:$|[\/\\])/.test(filename)) {
|
|
66
80
|
throw new Error();
|
|
67
81
|
}
|
package/dist/server.js
CHANGED
|
@@ -364,19 +364,9 @@ var X_ALREADY_SENT = "x-hono-already-sent";
|
|
|
364
364
|
|
|
365
365
|
// src/globals.ts
|
|
366
366
|
var import_node_crypto = __toESM(require("crypto"));
|
|
367
|
-
var webFetch = global.fetch;
|
|
368
367
|
if (typeof global.crypto === "undefined") {
|
|
369
368
|
global.crypto = import_node_crypto.default;
|
|
370
369
|
}
|
|
371
|
-
global.fetch = (info, init) => {
|
|
372
|
-
init = {
|
|
373
|
-
// Disable compression handling so people can return the result of a fetch
|
|
374
|
-
// directly in the loader without messing with the Content-Encoding header.
|
|
375
|
-
compress: false,
|
|
376
|
-
...init
|
|
377
|
-
};
|
|
378
|
-
return webFetch(info, init);
|
|
379
|
-
};
|
|
380
370
|
|
|
381
371
|
// src/listener.ts
|
|
382
372
|
var outgoingEnded = Symbol("outgoingEnded");
|
package/dist/server.mjs
CHANGED
|
@@ -329,19 +329,9 @@ var X_ALREADY_SENT = "x-hono-already-sent";
|
|
|
329
329
|
|
|
330
330
|
// src/globals.ts
|
|
331
331
|
import crypto from "crypto";
|
|
332
|
-
var webFetch = global.fetch;
|
|
333
332
|
if (typeof global.crypto === "undefined") {
|
|
334
333
|
global.crypto = crypto;
|
|
335
334
|
}
|
|
336
|
-
global.fetch = (info, init) => {
|
|
337
|
-
init = {
|
|
338
|
-
// Disable compression handling so people can return the result of a fetch
|
|
339
|
-
// directly in the loader without messing with the Content-Encoding header.
|
|
340
|
-
compress: false,
|
|
341
|
-
...init
|
|
342
|
-
};
|
|
343
|
-
return webFetch(info, init);
|
|
344
|
-
};
|
|
345
335
|
|
|
346
336
|
// src/listener.ts
|
|
347
337
|
var outgoingEnded = Symbol("outgoingEnded");
|
package/dist/vercel.js
CHANGED
|
@@ -362,19 +362,9 @@ var X_ALREADY_SENT = "x-hono-already-sent";
|
|
|
362
362
|
|
|
363
363
|
// src/globals.ts
|
|
364
364
|
var import_node_crypto = __toESM(require("crypto"));
|
|
365
|
-
var webFetch = global.fetch;
|
|
366
365
|
if (typeof global.crypto === "undefined") {
|
|
367
366
|
global.crypto = import_node_crypto.default;
|
|
368
367
|
}
|
|
369
|
-
global.fetch = (info, init) => {
|
|
370
|
-
init = {
|
|
371
|
-
// Disable compression handling so people can return the result of a fetch
|
|
372
|
-
// directly in the loader without messing with the Content-Encoding header.
|
|
373
|
-
compress: false,
|
|
374
|
-
...init
|
|
375
|
-
};
|
|
376
|
-
return webFetch(info, init);
|
|
377
|
-
};
|
|
378
368
|
|
|
379
369
|
// src/listener.ts
|
|
380
370
|
var outgoingEnded = Symbol("outgoingEnded");
|
package/dist/vercel.mjs
CHANGED
|
@@ -326,19 +326,9 @@ var X_ALREADY_SENT = "x-hono-already-sent";
|
|
|
326
326
|
|
|
327
327
|
// src/globals.ts
|
|
328
328
|
import crypto from "crypto";
|
|
329
|
-
var webFetch = global.fetch;
|
|
330
329
|
if (typeof global.crypto === "undefined") {
|
|
331
330
|
global.crypto = crypto;
|
|
332
331
|
}
|
|
333
|
-
global.fetch = (info, init) => {
|
|
334
|
-
init = {
|
|
335
|
-
// Disable compression handling so people can return the result of a fetch
|
|
336
|
-
// directly in the loader without messing with the Content-Encoding header.
|
|
337
|
-
compress: false,
|
|
338
|
-
...init
|
|
339
|
-
};
|
|
340
|
-
return webFetch(info, init);
|
|
341
|
-
};
|
|
342
332
|
|
|
343
333
|
// src/listener.ts
|
|
344
334
|
var outgoingEnded = Symbol("outgoingEnded");
|