@kiyasov/platform-hono 1.2.5 → 1.2.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiyasov/platform-hono",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "Nest adapter for Hono",
5
5
  "author": "Islam Kiiasov",
6
6
  "repository": {
@@ -238,7 +238,16 @@ export class HonoAdapter extends AbstractHttpAdapter<
238
238
  }
239
239
  break;
240
240
  default:
241
- (ctx.req as any).body = await ctx.req.parseBody({ all: true });
241
+ {
242
+ try {
243
+ if (rawBody) {
244
+ (ctx.req as any).rawBody = Buffer.from(await ctx.req.text());
245
+ }
246
+ (ctx.req as any).body = await ctx.req.json();
247
+ } catch {
248
+ (ctx.req as any).body = await ctx.req.parseBody({ all: true });
249
+ }
250
+ }
242
251
  break;
243
252
  }
244
253
  await next();