@kiyasov/platform-hono 1.4.7 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiyasov/platform-hono",
3
- "version": "1.4.7",
3
+ "version": "1.5.0",
4
4
  "description": "Nest adapter for Hono",
5
5
  "author": "Islam Kiiasov",
6
6
  "repository": {
@@ -343,9 +343,11 @@ export class HonoAdapter extends AbstractHttpAdapter<
343
343
  contentType?.startsWith('application/x-www-form-urlencoded')
344
344
  ) {
345
345
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
346
- (ctx.req as any).body = await ctx.req.parseBody({
347
- all: true,
348
- });
346
+ (ctx.req as any).body = await ctx.req
347
+ .parseBody({
348
+ all: true,
349
+ })
350
+ .catch(() => {});
349
351
  } else if (
350
352
  contentType?.startsWith('application/json') ||
351
353
  contentType?.startsWith('text/plain')
@@ -355,7 +357,7 @@ export class HonoAdapter extends AbstractHttpAdapter<
355
357
  (ctx.req as any).rawBody = Buffer.from(await ctx.req.text());
356
358
  }
357
359
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
358
- (ctx.req as any).body = await ctx.req.json();
360
+ (ctx.req as any).body = await ctx.req.json().catch(() => {});
359
361
  }
360
362
 
361
363
  await next();