@kiyasov/platform-hono 1.4.6 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/src/adapters/hono-adapter.js +6 -3
- package/dist/cjs/src/adapters/hono-adapter.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/adapters/hono-adapter.js +6 -3
- package/dist/esm/src/adapters/hono-adapter.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/adapters/hono-adapter.ts +8 -4
package/package.json
CHANGED
|
@@ -65,6 +65,8 @@ export class HonoAdapter extends AbstractHttpAdapter<
|
|
|
65
65
|
ctx.req['params'] = ctx.req.param();
|
|
66
66
|
|
|
67
67
|
await routeHandler(ctx.req, ctx, next);
|
|
68
|
+
|
|
69
|
+
return this.getBody(ctx);
|
|
68
70
|
};
|
|
69
71
|
}
|
|
70
72
|
|
|
@@ -341,9 +343,11 @@ export class HonoAdapter extends AbstractHttpAdapter<
|
|
|
341
343
|
contentType?.startsWith('application/x-www-form-urlencoded')
|
|
342
344
|
) {
|
|
343
345
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
344
|
-
(ctx.req as any).body = await ctx.req
|
|
345
|
-
|
|
346
|
-
|
|
346
|
+
(ctx.req as any).body = await ctx.req
|
|
347
|
+
.parseBody({
|
|
348
|
+
all: true,
|
|
349
|
+
})
|
|
350
|
+
.catch(() => {});
|
|
347
351
|
} else if (
|
|
348
352
|
contentType?.startsWith('application/json') ||
|
|
349
353
|
contentType?.startsWith('text/plain')
|
|
@@ -353,7 +357,7 @@ export class HonoAdapter extends AbstractHttpAdapter<
|
|
|
353
357
|
(ctx.req as any).rawBody = Buffer.from(await ctx.req.text());
|
|
354
358
|
}
|
|
355
359
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
356
|
-
(ctx.req as any).body = await ctx.req.json();
|
|
360
|
+
(ctx.req as any).body = await ctx.req.json().catch(() => {});
|
|
357
361
|
}
|
|
358
362
|
|
|
359
363
|
await next();
|