boxlang-express 0.2.21
Released .
- Sessions (
models/middleware/Session.bx): a changed session is written to the store inres.onBeforeSend(), before the response goes out, not only afternext()returns. With an out-of-process store the old order raced the client's next request: fetch a CSRF token, then POST the login form, and the POST could load the session before the token was written. Feedhouse carried a workaround middleware for this. The after-next()save stays for a chain that sent nothing, a store that failed before send (logged, not thrown, since the response is already marked sent), and a change made after sending, which is now compared case-sensitively. Still one write per request otherwise. - JSON bodies (
models/middleware/BodyParsers.bx): a body that doesn't parse gets a400({ error: true, message: "Malformed JSON body" }) directly, like the413beside it, instead of passing the parse exception tonext(), where it became a500. - Behavior change: error-handling middleware no longer sees malformed
JSON; an app that turned it into its own
400can drop that. - New
SessionPersistSpec, and a malformed-body case inInjectSpec.