honertia 0.1.27 → 0.1.29

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.
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAW,iBAAiB,EAAE,MAAM,MAAM,CAAA;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAA6B,MAAM,YAAY,CAAA;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,OAAO,QAAQ,MAAM,CAAC;IACpB,UAAU,kBAAkB;QAC1B,QAAQ,EAAE,gBAAgB,CAAA;KAC3B;CACF;AAqCD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,iBAAiB,CAgHlE;AAED,OAAO,EAAE,OAAO,EAAE,CAAA"}
1
+ {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAW,iBAAiB,EAAE,MAAM,MAAM,CAAA;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAA6B,MAAM,YAAY,CAAA;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,OAAO,QAAQ,MAAM,CAAC;IACpB,UAAU,kBAAkB;QAC1B,QAAQ,EAAE,gBAAgB,CAAA;KAC3B;CACF;AAqCD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,iBAAiB,CAqHlE;AAED,OAAO,EAAE,OAAO,EAAE,CAAA"}
@@ -97,7 +97,9 @@ export function honertia(config) {
97
97
  c.set('honertia', instance);
98
98
  await next();
99
99
  // Convert 302 to 303 for non-GET requests
100
+ // Guard against c.res being undefined (no handler matched)
100
101
  if (isHonertia &&
102
+ c.res &&
101
103
  c.res.status === 302 &&
102
104
  ['POST', 'PUT', 'PATCH', 'DELETE'].includes(c.req.method)) {
103
105
  const location = c.res.headers.get('Location');
@@ -108,6 +110,8 @@ export function honertia(config) {
108
110
  });
109
111
  }
110
112
  }
113
+ // Return the response to ensure proper propagation in forwarding scenarios
114
+ return c.res;
111
115
  };
112
116
  }
113
117
  export { HEADERS };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "honertia",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "description": "Inertia.js-style server-driven SPA adapter for Hono",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",