0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-22 19:44:26 +01:00
Commit Graph

22 Commits

Author SHA1 Message Date
Yusuke Wada
e07019125d
feat: introduce "Helpers" (#1353)
* mv jsx

* introduce helper

* denoify & add src/helper.ts for Deno

* remove `c` not used

* remove `c` in lagon test

* remove `src/adapter.ts` not used
2023-08-21 15:22:37 +09:00
Yusuke Wada
dc0696f2d1
refactor(context): allow passing HonoRequest as 1st arg (#1312)
* perf(context): allow passing `HonoRequest` as 1st arg

* denoify

* test: fix the node runtime test

* test: fix deno tests
2023-08-19 16:20:08 +09:00
Yusuke Wada
58127d7fea
refactor: lint (#1339) 2023-08-16 09:08:35 +09:00
watany
954c06ed4b
chore: add format script (#1334)
* add format

* yarn format:fix

* fix linter
2023-08-15 22:34:45 +09:00
watany
eefdb27e48
fix(adaptor): Access to custom request context on AWS Lambda Adaptor (#1305)
* v0.1

* lint

* test lint

* pritter

* prettier
2023-08-11 00:37:58 +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
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
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
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
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
9fd3cd3914 chore: pretty 2023-07-07 18:02:29 +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
Tom Lienard
09175e1289
fix(tests): Lagon env test (#1209) 2023-07-01 17:20:23 +09:00
Yusuke Wada
0e1755c9e4
feat: handle HEAD method (#1142)
* feat: handle HEAD method

* remove `head` from `METHOS`

* fixed the lagon test

* show `depracated` message (will be removed next minor? version)

* denoify

* use `request.url`

* denoify

* Invoke dispatch() without changing request.method for HEAD method. (#1152)

* Invoke `dispatch()` without changing request.method for HEAD method.

* chore: denoify

* refactored

* denoify

* refactor: dispatch() arguments can no longer be omitted (#1156)

* Revert "refactored"

This reverts commit 2f8dacc42d.

* refactor: `dispatch()` arguments can no longer be omitted

* denoifiy

---------

Co-authored-by: Taku Amano <taku@taaas.jp>
2023-06-03 09:07:33 +09:00
Yusuke Wada
2cfafe9642
fix(basic-auth): handle passing invalid value to atob() (#1122)
* fix(basic-auth): handle passing invalid value to `atob()`

* chore: denoify
2023-05-21 20:48:35 +09:00
Yusuke Wada
821a4082a9
fix(lambda): don't encode text (#1091) 2023-05-12 16:06:41 +09:00
watany
e7c0a512a1
feat(adapter): AWS Lambda Adapter supports requests via Lambda Function URLs. (#1076)
* feat(adapter):  Lambda Adapter supports Fn URLs.

* add comment

* fix schema

* fix lint
2023-05-10 14:38:41 +09:00
Yusuke Wada
21f4c196e7
feat(serve-static): rewriteRequestPath option for Workers/Deno/Bun (#1065) 2023-05-03 23:05:21 +09:00
Stefan Schonert
a2e6167478
feat(adapter): Added aws-handler support for APIGatewayProxyEventV2 (#1009)
* Added aws-handler support for APIGatewayProxyEventV2

* Ensure querystring from API Gateway and ELB

* remove log

* Minor refactor to follow conventions

* Missed function declaration

* Update handler and tests to use base64

* Revert disabling crypto
2023-05-03 21:34:36 +09:00
Yusuke Wada
f29761e16b
chore: move runtime tests into runtime_tests (#1062)
* chore: move runtime tests into `runtime_tests`

* fixed ci
2023-05-02 21:16:17 +09:00