Skip to content

Commit

Permalink
Fix hono adapter (#528)
Browse files Browse the repository at this point in the history
* Fix undefined is not an object error in hono adapter

* Remove undefined header fallback for hono adaptor

* Use hono .json() api for responses
  • Loading branch information
joshgillies committed Feb 10, 2024
1 parent bd67f5b commit 142f68d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/convenience/frameworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,12 @@ const hono: FrameworkAdapter = (ctx) => {
let resolveResponse: (res: Response) => void;
return {
update: ctx.req.json(),
header: ctx.req.headers.get(SECRET_HEADER) || undefined,
header: ctx.req.header(SECRET_HEADER),
end: () => {
resolveResponse(ctx.body());
},
respond: (json) => {
ctx.header('Content-Type", "application/json');
resolveResponse(ctx.body(json));
resolveResponse(ctx.json(json));
},
unauthorized: () => {
ctx.status(401);
Expand Down

0 comments on commit 142f68d

Please sign in to comment.