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

699 Commits

Author SHA1 Message Date
Arnaud Dagnelies
9af95c886e
fix: Updated CORS (#693)
* Updated CORS

Do not call `next` for OPTIONS pre-flight requests to avoid side effects and more sensible defaults.

* restoring default cors headers

* restoring cors default allowed methods to avoid breaking change

* Deno dist stuff
2022-12-01 00:11:06 +09:00
Dario Piotrowicz
1f43164da5
Fix Validation of optional empty/undefined arrays (#690)
* * fix(validator): allow empty and undefined optional arrays

fix the bug of empty and undefined array causing a validation fail
when those are anyways optional

resolves #677

* denonify changes
2022-11-30 19:48:43 +09:00
Taku Amano
86699c1868
fix(reg-exp-router): Copy from METHOD_NAME_ALL for new methods (#691)
* fix(reg-exp-router): Copy from METHOD_NAME_ALL for new methods

* chore: denoify

* fix(reg-exp-router): Initialize both middleware and routes.

* chore: denoify

* fix(reg-exp-router):Fix middleware search routine.

* chore: denoify
2022-11-30 10:08:28 +09:00
Dario Piotrowicz
07efdb5103
fix(validator): fix subsequent nested objects names (#683)
* fix(validator): fix subsequent nested objects names

fix the bug of having subsequent objects inside a nested structure
causing the validator to forget the previous keys in the scheme's path

fixes point 1 of #677

* deonify changes
2022-11-29 22:02:20 +09:00
Taku Amano
e9a54bb8fc
fix(reg-exp-router): Allows registering a star after a long prefix. (#684)
* fix(reg-exp-router): Allows registering a star after a long prefix.

* fix(reg-exp-router): It now works even if a short GET is registered after a long ALL.

* chore: denoify
2022-11-28 22:20:40 +09:00
Yusuke Wada
9f7b5de9aa chore: denoify 2022-11-28 08:45:57 +09:00
Dario Piotrowicz
35ab653f1b
fix(validator): fix jsons validation after arrays (#680)
* fix(validator): fix jsons validation after arrays

fix the bug of `v.json()` calls made after a `v.array()` to be mistakenly
considered as still being inside the array

fixes one of the issues mentioned in #677

* fixup! fix(validator): fix jsons validation after arrays

create new RecursiveValidator class

* fixup! fix(validator): fix jsons validation after arrays

remove RecursiveValidator class
2022-11-28 08:17:26 +09:00
Yusuke Wada
5b72c3ad6e v2.5.6 2022-11-26 16:04:11 +09:00
Yusuke Wada
8fcc9e6e3b chore: donoify 2022-11-26 15:59:50 +09:00
Taishi Naritomi
95973a5b95
fix(package.json): add "type": "module" (#679) 2022-11-26 15:45:24 +09:00
Yusuke Wada
8500949bd6 v2.5.5 2022-11-23 18:58:30 +09:00
Yusuke Wada
a3e0eb2cc1
refactor(context): refactor context.ts (#674) 2022-11-23 18:42:24 +09:00
Yusuke Wada
1eb49b8d96
refactor: support new @cloudflare/worker-types (#673)
* refactor: support new `@cloudflare/worker-types`

* do not attach crypto to global

* denoify ignore serve-static for cloudlfare

* ignore the utility for cloudflare

* import types
2022-11-23 07:27:42 +09:00
Yusuke Wada
5456709b4c chore(package.json): update the description 2022-11-20 23:42:23 +09:00
Yusuke Wada
ca9cb0cdf9 v2.5.4 2022-11-20 21:39:33 +09:00
Yusuke Wada
d01ed4da8a
fix(package.json): add typesVersions section (#670) 2022-11-20 21:37:37 +09:00
Yusuke Wada
797688f493 v2.5.3 2022-11-20 15:51:20 +09:00
Yusuke Wada
d2fa90f0fe
fix(package.json): exports types correctly (#669)
* fix(package.json): exports types correctly

* make jest config commonjs
2022-11-20 15:46:18 +09:00
Yusuke Wada
05f2f6eb10 fix(types): app.use return correct types
Fix #666
2022-11-19 15:49:22 +09:00
oscaryu
9f2d52b62e
Update MIGRATION.md (#665) 2022-11-19 15:23:00 +09:00
Yusuke Wada
8ab08c444e v2.5.2 2022-11-17 15:14:20 +09:00
Yusuke Wada
1674bbba32 chore(denoify): update Buffer 2022-11-17 15:11:36 +09:00
Jayden
06cecbd1e2
fix(param): Decode context.param (#662)
* Decode url param

* Denoify
2022-11-14 09:10:03 +09:00
Yusuke Wada
ce31e2ac30 v2.5.1 2022-11-13 10:26:05 +09:00
Jayden
e92dbe9558
fix(sanitizer) (#661)
* Add test for #660

* Implement sanitizeValue

* Mark sanitizeValue private
2022-11-12 20:33:18 +09:00
Yusuke Wada
d3a6f80d7c
fix(type): change the type definition of req in Context (#658) 2022-11-11 15:23:05 +09:00
Yusuke Wada
b82547f70a v2.5.0 2022-11-08 07:04:09 +09:00
Yusuke Wada
58ef70f0cf
fix(types): export ErrorHandler and NotFoundHandler (#656) 2022-11-08 07:02:54 +09:00
Yusuke Wada
b963d6e7cb
feat(app): introduce app.on(method, path, handler) (#653)
* feat(app): introduce `app.on(method, path, handler)`

* Refactoring of feat/on branche (#655)

* refactor(reg-exp-router): Use `includes` instead of `find` to check if an element is in an array.

* fix(static-router): Copy middleware from METHOD_NAME_ALL for new method.

* chore: denoify

Co-authored-by: Taku Amano <taku@taaas.jp>
2022-11-08 03:17:34 +09:00
Yusuke Wada
15a5119bac
feat(app): introduce app.showRoutes() (#650) 2022-11-05 19:04:01 +09:00
Yusuke Wada
edfb31ee94
fix(error): make notFound() enables to catch errors correctly (#652) 2022-11-05 19:02:19 +09:00
Yusuke Wada
888e04ded1
fix(context): check cloudflare before checking node in c.runtime (#651)
* fix(context): check cloudflare before checking node in `c.runtime`

* denoify
2022-11-04 07:14:57 +09:00
Yusuke Wada
4a9cd272f8
refactor(types): reduce type definitions (#649)
* refactor(types): reduce type definitions

* fixed tests for Deno and Bun
2022-11-03 15:53:41 +09:00
Yusuke Wada
8e9b1c8099
fix(type): make compatibility with @cloudflare/workers-types (#645) 2022-11-03 15:39:25 +09:00
Jayden
451d6fe117
feat(context): Introducing c.runtime (#644)
* Add context.platform getter

* Remove assumption on fastly

* Add Vercel support

* denoify

* Replace .platform with .runtime
2022-11-03 15:35:23 +09:00
Yusuke Wada
fadce52673 v2.4.1 2022-11-01 21:44:20 +09:00
Yusuke Wada
c3031a418c
fix(jsx): export fragment (#642) 2022-11-01 21:41:27 +09:00
Yusuke Wada
4d7c941836 v2.4.0 2022-11-01 17:45:16 +09:00
Yusuke Wada
da55bf922f chore: denoify 2022-11-01 17:42:25 +09:00
Jayden
dcc21afe6d
test(routing): add test cases for route grouping order (#640)
* Add test cases for route grouping

* fix(validator): enable handling "Bad Request" in validator (#635)

* feat(types): introduce `CustomHandler` interface (#637)

* Fix nested test

Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
2022-11-01 17:37:49 +09:00
Yusuke Wada
44eb4bb6c6
fix(types): improve custom handler (#641) 2022-11-01 17:13:13 +09:00
Yusuke Wada
c14dd5ad43
feat(validator): support v.queries (#636) 2022-11-01 14:22:04 +09:00
Yusuke Wada
6a96ace96a
feat(types): introduce CustomHandler interface (#637) 2022-11-01 00:07:56 +09:00
Yusuke Wada
7b8a25126f
fix(validator): enable handling "Bad Request" in validator (#635) 2022-11-01 00:03:17 +09:00
Taishi Naritomi
ddbea5be70
fix(typo): package.cjs.json target to type (#634) 2022-10-29 16:09:32 +09:00
Yusuke Wada
1749f6a962
test(bun): JWT middleware works on Bun v0.2.2 (#633) 2022-10-29 00:09:09 +09:00
Yusuke Wada
ca52dd898e
fix(build): fix ESM support in Node.js / use esbuild (#631)
* fix(build): fix ESM support in Node.js / use `esbuild`

* add tsx

* denoify ignore
2022-10-28 08:46:02 +09:00
Yusuke Wada
d8da569299 v2.3.2 2022-10-25 00:02:29 +09:00
Yusuke Wada
d7a36b34fd
feat(validator): export Validator from 'hono' (#627) 2022-10-24 23:59:46 +09:00
Yusuke Wada
5b3e7f8fd7
fix(deno): export static-router and smart-router (#626) 2022-10-24 23:22:05 +09:00