0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-25 13:19:30 +01:00
Commit Graph

1246 Commits

Author SHA1 Message Date
Yusuke Wada
1ed9ce1f56
fix(package.json): export hono-base (#1604) 2023-10-21 23:58:38 +09:00
watany
76a2c7f523
chore(ci): bun v1 (#1599)
* chore(ci): bun v1

* bun use jsx

* bun version
2023-10-20 18:18:05 +09:00
watany
fc9bdad5f5
chore(ci): update node v20 (#1598)
* update node v20

* node test

* only one Main
2023-10-20 15:21:38 +09:00
Yusuke Wada
62d4d44d34
test(validator): fix the error message for node v18.18 (#1596)
* test(validator): fix the error message for node v18.18

* ci: fix node version

* fixed version

* test: fix the test pattern
2023-10-18 22:38:37 +09:00
Yusuke Wada
850ae92c47
fix(context): change FetchEvent detection way (#1595)
* fix(context): change `FetchEvent` detection way

* denoify
2023-10-18 22:24:19 +09:00
Yusuke Wada
46b9b53e90 v3.8.1 2023-10-18 12:36:22 +09:00
Taku Amano
b94897d6c0
fix: c.req.params() in nested app with custom error handler. (#1593)
* fix: `c.req.params()` in nested app with custom error handler.

* chore: denoify
2023-10-18 12:28:37 +09:00
Yusuke Wada
6cf794fde1 v3.8.0 2023-10-17 09:45:44 +09:00
Yusuke Wada
70d83cb3c9
Merge pull request #1589 from honojs/next
Next
2023-10-17 09:40:33 +09:00
Yusuke Wada
68808453d5
refactor: refactored hono-base (#1588)
* refactor: refactored `hono-base`

* denoify
2023-10-17 06:36:09 +09:00
Yusuke Wada
319f49d493
Revert "feat(app): basePath option for the constructor, deprecate app.basePath() (#1560)" (#1586)
This reverts commit 8b6bd46e66.
2023-10-17 06:24:59 +09:00
Yusuke Wada
766eebbf5d
feat(deno): export the factory helper for Deno (#1582) 2023-10-16 20:01:19 +09:00
Yusuke Wada
9f5b7298ab
fix(factory): fixed the comment (#1581)
* fix(factory): fixed the comment

* denoify
2023-10-16 19:50:35 +09:00
Yusuke Wada
ec39f44cb2
fix(streaming): fix SSE format (#1579)
* fix(streaming): fix SSE format

* denoify
2023-10-16 18:54:28 +09:00
Yusuke Wada
3247f76aed
feat(package.json): export streaming helper (#1578) 2023-10-16 18:13:09 +09:00
Yusuke Wada
9a73d5fbfc v3.8.0-rc.3 2023-10-16 09:11:50 +09:00
Yusuke Wada
7188827537 Merge branch 'main' into next 2023-10-16 09:09:25 +09:00
Yusuke Wada
8b6bd46e66
feat(app): basePath option for the constructor, deprecate app.basePath() (#1560)
* feat(app): `basePath` option for the constructor, deprecate `app.basePath()`

* denoify

* refactor: `HonoOptions`

* denoify
2023-10-16 09:04:58 +09:00
Yusuke Wada
690765d2a4
test: fix the sleep time for SSE (#1575) 2023-10-16 08:40:10 +09:00
Taku Amano
ec94acd909
feat: one params per a handler (optimized for RegExpRouter) (#1566)
Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
2023-10-16 08:39:37 +09:00
Yusuke Wada
b6c0e45d5f
chore: bump up denoify (#1570) 2023-10-13 08:59:27 +09:00
Yusuke Wada
8ba721e654 v3.7.6 2023-10-12 18:13:34 +09:00
Yusuke Wada
2f9a07dda9
perf(hono-base): use instanceOf (#1565)
* perf(hono-base): use `instanceOf`

* denoify
2023-10-12 17:48:36 +09:00
Bruno Marques
cca7577cf4
fix: return status 500 when using validator 'form' (#1554)
* fix: return status 500 when using validator 'form'

When using `validator('form', ...)` hono is returning a 500 status
when receiving a POST request with a JSON in request body, instead
of a bad request 400, .

This is happenning due to a unhandled error in an
underlying library (@miniflare).
https://github.com/cloudflare/miniflare/pull/711

The code changes in this PR are responsible to prepare the code to
handle possible TypeError that can be thrown in the future, by the lib
doing the FormData parsing, as per, https://fetch.spec.whatwg.org/#dom-body-formdata.

This PR should wait for bugfix on @miniflare.

* fix: json validator allowing Content-Type value other than json/application

Forgery attacks will try to avoid preflight requests when POSTing JSON
payloads manipulating the HTTP header Content-Type. For example, it will
send a JSON payload with `Content-Type=text/plain`, but the request stills
containing a JSON in its body. Those requests must be rejected.

Thus, when using the validator with the target set to `json`, we must
check the Content-Type header.

* fix: change check for json Content-Type header

Change JSON validation to only allow Content-Type header starting with
'application/json'.

Change from regexp test to starsWith builtin function, to make code more
expressive.

---------

Co-authored-by: Bruno Nascimento <bruno.nascimento@csghq.com>
2023-10-12 00:21:01 +09:00
Yusuke Wada
90259f3acb
test: use Node.js Native Web APIs instead of miniflare's (#1558)
* test: use Node.js Native Web APIs instead of miniflare's

* `denoify-ignore`
2023-10-10 21:32:10 +09:00
Taku Amano
0e77991429
feat(reg-exp-router): Improve capture group support. (#1556)
* feat(reg-exp-router): Improve capture group support.

* chore: denoify
2023-10-10 07:49:59 +09:00
Yusuke Wada
3d3f7cdf87 v3.8.0-rc.2 2023-10-06 08:43:32 +09:00
Yusuke Wada
2feb300578 Merge branch 'main' into next 2023-10-06 05:17:45 +09:00
Yusuke Wada
3e4f151fa9 v3.7.5 2023-10-06 05:16:02 +09:00
Yusuke Wada
c703dd3726
fix(types): don't use webworker types (#1548)
* fix(types): don't use webworker types

* denoify
2023-10-06 05:14:16 +09:00
Yusuke Wada
48c9fed011 v3.8.0-rc.1 2023-10-05 18:12:50 +09:00
Taku Amano
b05ed376b2
feat(jsx): Introduce Context API and jsx-renderer middleware (#1496)
Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
2023-10-05 16:57:33 +09:00
Arunava Basu
8aea6e5a42
feat: rename middleware to createMiddleware (#1540)
* feat: rename middleware to createMiddleware and mdoify tests

* feat:yarn denoify

* feat:formatted

* feat:cleanup

* feat:cleanup

* feat: denoify
2023-10-05 16:40:38 +09:00
Sor4chi
e4f7f971a8
feat: parseBody() for multi values' field (#1528)
* feat: add "all" option to parseBody

* feat: add parseBody option to `req.parseBody()`

* test: add single value (override) and multiple value cases to praseBody

* test: split parse case of parseBody

* chore: denoify

* refactor(body): make clear parseBody logic

* chore: denoify

* fix: single value of the field should not be parsed to array

* test: add some case of single value's field in "all" option

* chore: denoify
2023-10-05 16:33:56 +09:00
watany
96476a787b
feat(helper): streaming-sse (#1504)
* feat(helper): streaming-sse

* lint-check

* fixed streaming

* few fixed.

* denoify
2023-10-05 16:33:34 +09:00
Yusuke Wada
db3c1a75e8 v3.7.4 2023-10-05 06:09:28 +09:00
Yusuke Wada
3844b41dd4
fix(vercel): pass request context (#1543) 2023-10-05 00:53:57 +09:00
Yusuke Wada
6a9590d69c
fix(jsx): render a child or odd children with Fragment correctly (#1541)
* fix(jsx): render a child or odd children with `Fragment` correctly

* denoify
2023-10-05 00:18:18 +09:00
Yusuke Wada
93fec337d0
refactor(hono-base): remove any casting (#1535)
* refactor(hono-base): remove `any` casting

* denoify
2023-10-03 23:19:05 +09:00
Yusuke Wada
e326208fdf
fix(context): use FetchEvent instead of FetchEventLike (#1532) 2023-10-03 23:09:16 +09:00
Yusuke Wada
82f103302b v3.7.3 2023-09-30 22:04:36 +09:00
watany
43749a0efd
feat(adaptor): Accessable Lambda "Context" (#1523)
* adding lambda-context

* format

* type any

* ignore denoify

* export type
2023-09-30 21:55:35 +09:00
Yusuke Wada
dddd4978d8
fix(types): fix inferring path strings for an optional parameter with regexp (#1522)
* fix(types): fix inferring path strings for optional parameters with regexp

* denoify

* fix the test
2023-09-29 06:49:52 +09:00
Yusuke Wada
731957aea2 v3.7.2 2023-09-23 23:47:34 +09:00
Yusuke Wada
c7fc8a033a
fix(utils/buffer): fix bufferToFormData() (#1500)
* fix(utils/buffer): fix `bufferToFormData()`

* denoify
2023-09-23 23:46:09 +09:00
Yusuke Wada
cefa08bf58 v3.7.1 2023-09-22 07:28:41 +09:00
Yusuke Wada
a18828886f
fix(deno): export testing helper (#1493) 2023-09-22 06:30:25 +09:00
Yusuke Wada
93f629b560 v3.7.0 2023-09-21 11:49:12 +09:00
Yusuke Wada
3eb52bc102
Merge pull request #1489 from honojs/next 2023-09-21 11:44:56 +09:00
Nico Plyley
d6478aac6c
fix(jwt): incorrect error message (#1487) 2023-09-21 06:14:48 +09:00