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.
- package/dist/middleware.d.ts.map +1 -1
- package/dist/middleware.js +4 -0
- package/package.json +1 -1
package/dist/middleware.d.ts.map
CHANGED
|
@@ -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,
|
|
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"}
|
package/dist/middleware.js
CHANGED
|
@@ -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 };
|