@mastra/deployer 1.56.0-alpha.4 → 1.56.0-alpha.5

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.
@@ -2608,14 +2608,18 @@ var MastraServer$1 = class extends MastraServer {
2608
2608
  const shouldApplyBodyLimit = this.bodyLimitOptions && [
2609
2609
  "POST",
2610
2610
  "PUT",
2611
- "PATCH"
2611
+ "PATCH",
2612
+ "DELETE"
2612
2613
  ].includes(route.method.toUpperCase());
2613
2614
  const maxSize = route.maxBodySize ?? this.bodyLimitOptions?.maxSize;
2614
2615
  const middlewares = [];
2615
- if (shouldApplyBodyLimit && maxSize && this.bodyLimitOptions) middlewares.push(bodyLimit({
2616
- maxSize,
2617
- onError: this.bodyLimitOptions.onError
2618
- }));
2616
+ if (shouldApplyBodyLimit && maxSize && this.bodyLimitOptions) {
2617
+ const { onError } = this.bodyLimitOptions;
2618
+ middlewares.push(bodyLimit({
2619
+ maxSize,
2620
+ onError: (c) => c.json(onError({ error: "Request body too large" }), 413)
2621
+ }));
2622
+ }
2619
2623
  app[route.method.toLowerCase()](`${prefix}${route.path}`, ...middlewares, async (c) => {
2620
2624
  const authResult = await this.checkRouteAuth(route, {
2621
2625
  path: c.req.path,