@kiyasov/platform-hono 1.1.7 → 1.1.9

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.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "Nest adapter for Hono",
5
5
  "author": "Islam Kiiasov",
6
6
  "license": "MIT",
@@ -209,13 +209,14 @@ export class HonoAdapter extends AbstractHttpAdapter<
209
209
  Logger.log("Registering body parser middleware");
210
210
  this.instance.use(this.bodyLimit(bodyLimit), async (ctx, next) => {
211
211
  const contentType = ctx.req.header("content-type");
212
+
212
213
  switch (type) {
213
214
  case "application/json":
214
- if (contentType === "application/json")
215
+ if (contentType?.startsWith("application/json"))
215
216
  (ctx.req as any).body = await ctx.req.json();
216
217
  break;
217
218
  case "text/plain":
218
- if (contentType === "text/plain") {
219
+ if (contentType?.startsWith("text/plain")) {
219
220
  (ctx.req as any).rawBody = Buffer.from(await ctx.req.text());
220
221
  (ctx.req as any).body = await ctx.req.json();
221
222
  }