0
0
mirror of https://github.com/honojs/hono.git synced 2024-12-01 11:51:01 +01:00
Commit Graph

1080 Commits

Author SHA1 Message Date
Yusuke Wada
f7bce19751
fix(validator): support async validator func (#1303)
* fix(validator): support async validator func

* denoify
2023-08-07 21:26:53 +09:00
Yusuke Wada
85f8ab663f
refactor(app): add "deprecate message" for app.handleEvent() (#1298)
* refactor(app): add "deprecate message" for `app.handleEvent()`

* denoify
2023-08-05 23:41:45 +09:00
Yusuke Wada
4a3c5834de
chore(benchmark): update the handle-event benchmark (#1297)
* chore(benchmark): update the handle-event benchmark

* denoify
2023-08-05 23:37:41 +09:00
Yusuke Wada
8e2eaf9d24
docs(jsdoc): fix a app.route() JSDoc description (#1296)
* docs(jsdoc): fix a `app.route()` JSDoc description

* denoify
2023-08-05 23:28:34 +09:00
Yusuke Wada
8b0f189a3f refactor(json-pretty): don't use c.pretty() (#1288) 2023-08-05 18:14:57 +09:00
Yusuke Wada
09368ac9cc
feat(adapter): add Netlify adapter (#1290)
* feat(adapter): add Netlify adapter

* denoify
2023-08-05 18:12:02 +09:00
Yusuke Wada
85b54920f9
feat(parseBody): allow passing generics to parseBody() (#1289)
* feat(parseBody): allow passing generics to `parseBody()`

* denoify
2023-08-05 18:10:12 +09:00
byunghoo.yu
a7dd281827
fix(adapter/aws-lambda): use content-encoding to determine isBase64Encoded (#1295)
* aws-lambda adapter: use content-encoding to determine isBase64Encoded

* when contentType is binary, skip checking contentEncoding

* prettier
2023-08-05 18:08:19 +09:00
Torsten Engelbrecht
35246d0de6
feat(middleware): Simple cookie signing functionality (#1279) 2023-08-05 17:19:08 +09:00
Yusuke Wada
47ae014724
perf(context): add init flag (#1284)
* perf(context): add `init` flag

* denoify
2023-08-04 00:09:12 +09:00
Yusuke Wada
d5cfe040d8
fix(types): add a missing handler type (#1283)
* fix(types): add a missing handler type

* fix & denoify
2023-08-03 23:09:58 +09:00
Yusuke Wada
379e3becf9
test(app): add more tests for hostname-routing (#1282) 2023-08-02 11:37:58 +09:00
watany
4f7d027f5b
doc(readme): adding Lambda@Edge (#1278) 2023-08-01 10:38:28 +09:00
Yusuke Wada
e851e9bd82
perf(utils/url): use regexp instead of indexOf() (#1276)
* perf(utils/url): use regexp instead of `indexOf()`

* remove unused file

* denoify
2023-07-29 23:38:55 +09:00
Yusuke Wada
8ea833a7d0
refactor(hono-base): remove async/await from app.request (#1275)
* refactor(hono-base): remove async/await from `app.request`

* denoify
2023-07-28 17:52:11 +09:00
Yusuke Wada
42294d9f1c
chore: tweak jest.config.js (#1274)
* chore: tweak `jest.config.js`

* fix for lagon test
2023-07-28 16:26:04 +09:00
Yusuke Wada
3d9c6b2338 v3.3.4 2023-07-27 12:16:21 +09:00
Yusuke Wada
5dc0975bd2
feat(cloudflare-pages): add serveStatic() (#1273) 2023-07-27 12:12:59 +09:00
Yusuke Wada
77b7ac7fe7
fix(utils/filepath): allow .. in filename (#1272)
* fix(utils/filepath): allow `..` in filename

* denoify

* support `./foo../bar.txt`

* denoify

* add tests

---

Co-authored-by: Taku Amano <taku@taaas.jp>
2023-07-27 11:43:42 +09:00
DianomiJH
8ef9b5e0b0
fix(lambda): added generic parameters to aws-lambda handler to fix #1265 (#1269) 2023-07-27 09:43:07 +09:00
Yusuke Wada
614ab9d6e4
fix(utils/filepath): don't allow dot segments (#1271) 2023-07-27 08:37:20 +09:00
Codinak
1495f8b41b
fix(jsx): escapeToBuffer vulnerability (#1266)
* fix escapeToBuffer vulnerability

Escape single quote (0x27) to limit execution capabilities under certain conditions.

* denoify
2023-07-26 23:12:25 +09:00
watany
cbd5616e9d
fix(lambda-edge) Adding Export Type CloudFrontResponse and CloudFrontConfig (#1263)
* export type

* revert
2023-07-25 07:44:57 +09:00
Yusuke Wada
84973c999d v3.3.3 2023-07-23 16:20:23 +09:00
Yusuke Wada
b0a368676e
fix(hono-base): enable strict with getPath option (#1259)
* fix(hono-base): enable `strict` with `getPath` option

* denoify
2023-07-23 16:03:45 +09:00
watany
ba346a4b63
feat(adaptor): Lambda@Edge supports response callbacks (#1251)
* change header

* fixed

* simple test

* minify

* refactor

* fix

* binding response

* fix

* fix

* remove fix

* remove lowercase
2023-07-21 16:59:32 +09:00
Yusuke Wada
14f5536ec6 v3.3.2 2023-07-20 17:52:22 +09:00
Yusuke Wada
5c1f7f033c
fix(hono/quick): use SmartRouter (#1250)
* fix(hono/quick): use SmartRouter

* denoify
2023-07-20 17:43:35 +09:00
Yusuke Wada
47dbeaa147
fix(trie-router-router): For "Named param with trailing wildcard" (#1246)
* fix(trie-router-router): For "Named param with trailing wildcard"

* denoify
2023-07-20 16:48:38 +09:00
Taku Amano
3e663af916
fix(pattern-router): For "Named param with trailing wildcard" (#1244)
* fix(pattern-router): For "Named param with trailing wildcard"

* chore: denoify
2023-07-20 16:48:21 +09:00
James A Rosen
4b39eba618
refactor(etag): simplify cloning logic (#1242)
If the upstream response doesn't include an `ETag` header, the ETag
middleware needs to clone the response so it can read the body to
compute an ETag. This commit simplifies the management of the original
and cloned responses.
2023-07-19 09:57:57 +09:00
Yusuke Wada
0a0dac7c60 v3.3.1 2023-07-16 15:37:28 +09:00
watany
301e142163
fix: Safe modification of Buffer (#1238)
* refactor lambda-edge

* refactor lambda
2023-07-15 20:44:54 +09:00
markthree
0efc6952a3
perf(deno/middlewares/serveStatic): serve static with stream (#1234)
* perf(deno/middlewares/serveStatic): serve static with stream

* Revert "perf(deno/middlewares/serveStatic): serve static with stream"

This reverts commit 0360966d1e.

* fix(deno/middlewares/serveStatic): fix position and test for serve static with stream

* chore(deno/middlewares/serveStatic): clean temp dist files
2023-07-15 14:28:48 +09:00
Yusuke Wada
42dc3646a0
fix(cache): clone the response (#1232)
* fix

* clone the response shortly

* add test for not found

* denoify

---------

Co-authored-by: brn <brn@b6n.ch>
2023-07-15 09:36:03 +09:00
Denis Washington
2a6d17551b
fix: AWS Lambda: Avoid text-encoding binary data (#1235)
So far, the AWS Lambda adapter has used `atob` to convert a Base64-encoded
request body to a binary. However, `atob` returns a string, and passing
that to the `Request` constructor (at least on Node.js, which Lambda
runs on) results in the binary string being encoded as UTF-8. This means
that if the request body contains bytes which are not in the ASCII
range, they are replaced with UTF-8 multi-byte encodings, which leads
to `c.req.blob()`, `c.req.formData()`, etc. returning the wrong binary
data!

This commit fixes the issue by replacing `atob(body)` with
`Buffer.from(body, 'base64')`, which does not have that problem. The
`Buffer` can be directly passed as body for `new Request()` because it
implements the `Uint8Array` interface. While this makes the AWS Lambda
adapter depend directly on the "node:buffer" module, this should be fine
because AWS Lambda functions always run on Node.
2023-07-15 09:35:32 +09:00
Yusuke Wada
5090c3c817 v3.3.0 2023-07-11 10:10:34 +09:00
Yusuke Wada
d48c160542
feat(lambda-edge): pass the context and callback as env (#1229) 2023-07-10 23:04:13 +09:00
watany
f37de258b8
fix(lambda-edge): update schema and refactor (#1230)
* remove array check

* update if

* fix test

* fix origin infomation
2023-07-10 22:58:18 +09:00
Yusuke Wada
096e3b7dd1 v3.3.0-rc.1 2023-07-08 18:31:28 +09:00
Yusuke Wada
cef0adb1d6
fix(mount): include query params (#1224)
* fix(mount): include query params

* denoify
2023-07-08 18:25:50 +09:00
Yusuke Wada
9fd3cd3914 chore: pretty 2023-07-07 18:02:29 +09:00
watany
c2cbc0a80b
ci: update ci action (#1222) 2023-07-07 17:48:36 +09:00
watany
edca699b96
feat(adapter): AWS Lambda Adapter supports requests via Lambda@edge (#1210)
* edge-adaptor

* add env

* Revert "add env"

This reverts commit 9662e574fd.

* Revert "add env"

This reverts commit 9662e574fd.

* v0.1

* Revert "edge-adaptor"

This reverts commit ed6b2566b1.

* runtimetest

* WIP: runtime-test

* lint

* build lambda-edge

* ci lambda-edge

* remove gitpod

* test fix

* fix of self check
2023-07-07 17:41:33 +09:00
Yusuke Wada
a8ebb47ddd
docs: add a svg logo image (#1217) 2023-07-04 18:45:55 +09:00
Pascal
b0e0ce85a0
feat: Add Server-Timing API as middleware (#1215)
* feat(timing): add Server-Timing API as middleware

* refactor(timing): rename config to TimingOptions
2023-07-03 11:19:49 +09:00
flow
d6f4d1a501
Fix replaceUrlParam to ignore regexp in path (#1214)
* Fix replaceUrlParam to ignore regexp in path

* Generate deno_dist files
2023-07-02 22:25:19 +09:00
Tom Lienard
09175e1289
fix(tests): Lagon env test (#1209) 2023-07-01 17:20:23 +09:00
Yusuke Wada
3891845458 v3.2.7 2023-06-29 20:13:56 +09:00
Yusuke Wada
8ebd8b7b76
fix(jsonT): remove overloads from JSONTRespond (#1208)
* fix(`jsonT`): remove overloads from `JSONTRespond`

* denoify

* update tests
2023-06-29 20:09:00 +09:00