hono-adapter-aws-lambda 1.2.0 → 1.3.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.
Files changed (2) hide show
  1. package/dist/index.mjs +6 -2
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -312,8 +312,12 @@ function minimalEvent(method, path, baseEvent) {
312
312
  },
313
313
  routeKey: ""
314
314
  });
315
- event.headers ?? (event.headers = {});
316
- (_a = event.headers)["content-type"] ?? (_a["content-type"] = "application/json");
315
+ if (method !== "GET" && method !== "HEAD") {
316
+ event.headers ?? (event.headers = {});
317
+ (_a = event.headers)["content-type"] ?? (_a["content-type"] = "application/json");
318
+ if (typeof event.body !== "string")
319
+ event.body = JSON.stringify(event.body);
320
+ }
317
321
  event.routeKey = event.requestContext.routeKey = `${method} ${path}`;
318
322
  event.requestContext.http.method = method;
319
323
  event.rawPath = event.requestContext.http.path = path;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hono-adapter-aws-lambda",
3
3
  "type": "module",
4
- "version": "1.2.0",
4
+ "version": "1.3.0",
5
5
  "packageManager": "pnpm@9.8.0",
6
6
  "description": "",
7
7
  "author": "NamesMT <dangquoctrung123@gmail.com>",