boxlang-express 0.2.30
Released .
- An error after the response is sent is logged (
models/Router.bx, #8). A handler that threw, or callednext( err ), afterres.send()had its error dropped: error handlers are skipped because nothing more can be sent, and nothing was printed either. It now writes one line to stdout —Error after the response was sent, GET /path: message— with the request id whenrequestIdis on. The response is unchanged and error handlers are still skipped. A client that disconnects in the middle of a download or an SSE stream now produces this line too. - Changed behaviour:
boxExpressCsrf()mints its token on the firstreq.csrfToken()call (models/middleware/Csrf.bx, #9). It used to writereq.session.csrfTokenon every request, so with the session and CSRF middleware mounted app-wide every anonymous request became a stored session andsaveUninitialized: falsedid nothing. A request that never asks for a token now leaves the session alone. An unsafe request whose session has no token gets the same403as before, and no token is minted for it. Code that readreq.session.csrfTokendirectly, without callingreq.csrfToken(), will find it unset. res.renderToString( view, data )(models/Response.bx, #10) returns whatres.render()would send without sending it: the sameapp.locals/res.locals/datamerge and the same layout rules, includinglayout: false.render()is nowrenderToString()plus the send.