@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/dist/cjs/src/adapters/hono-adapter.js +5 -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 +5 -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 +6 -4
package/package.json
CHANGED
|
@@ -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
|
|
347
|
-
|
|
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();
|