@kiyasov/platform-hono 1.2.3 → 1.2.4
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 +8 -4
- 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 +8 -4
- 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 -5
package/package.json
CHANGED
|
@@ -221,17 +221,20 @@ export class HonoAdapter extends AbstractHttpAdapter<
|
|
|
221
221
|
this.instance.use(this.bodyLimit(bodyLimit), async (ctx, next) => {
|
|
222
222
|
const contentType = ctx.req.header("content-type");
|
|
223
223
|
|
|
224
|
-
if (rawBody) {
|
|
225
|
-
(ctx.req as any).rawBody = Buffer.from(await ctx.req.text());
|
|
226
|
-
}
|
|
227
|
-
|
|
228
224
|
switch (type) {
|
|
229
225
|
case "application/json":
|
|
230
|
-
if (contentType?.startsWith("application/json"))
|
|
226
|
+
if (contentType?.startsWith("application/json")) {
|
|
227
|
+
if (rawBody) {
|
|
228
|
+
(ctx.req as any).rawBody = Buffer.from(await ctx.req.text());
|
|
229
|
+
}
|
|
231
230
|
(ctx.req as any).body = await ctx.req.json();
|
|
231
|
+
}
|
|
232
232
|
break;
|
|
233
233
|
case "text/plain":
|
|
234
234
|
if (contentType?.startsWith("text/plain")) {
|
|
235
|
+
if (rawBody) {
|
|
236
|
+
(ctx.req as any).rawBody = Buffer.from(await ctx.req.text());
|
|
237
|
+
}
|
|
235
238
|
(ctx.req as any).body = await ctx.req.json();
|
|
236
239
|
}
|
|
237
240
|
break;
|