boxlang-express 0.2.20
Released .
Behavior changes below before upgrading.
- Routing: skipping routes no longer recurses once per skipped layer. An app with ~550 routes and middleware overflowed the stack on any 404 (500 error); 3,000+ now work, and a 404 past 500 routes went from 258 ms to about 22 ms.
- Static files: dotfiles are ignored by default (
/.envwas served);dotfiles: "deny" | "allow";/.well-known/always served. Added.mjs,.webp,.wasm,.mapand other common types (ES modules were served asapplication/octet-stream). - Streamed file responses:
res.sendFile(),res.download()and static files stream from disk instead of reading the whole file into memory per request (HEADincluded). Range offsets past 2 GB were clamped to the same wrong position; fixed. trust proxytakes a hop count or a list of proxy addresses/CIDRs, as in Express, soreq.ip(and the rate-limit key) can't be picked by a client behind a proxy that appends toX-Forwarded-For.X-Forwarded-Proto/-Hostare believed only from a trusted peer.- Cluster relay:
secretKey(16+ characters) is now required to relay STOMP messages — an unset one used to leave/__clusteropen to anyone who could reach the port. Compared in constant time, case-sensitively. - CSRF: the token is compared in constant time and case-sensitively
(BoxLang's
!=is neither); a JSON array body no longer errors. - WebSockets: same-origin check on
app.ws()handshakes, with{ origins }per route andapp.set("wsOrigins"). - CORS:
credentials: truewithorigin: trueor"*"now throws;Vary: Originis sent whenever the response depends onOrigin. - Sessions:
req.regenerateSession()for login; the in-memory store is capped bymaxSessions(default 100,000) and sweeps expired entries at most every 30 seconds instead of scanning on every 100th write. - Uploads: the stored extension is kept only if alphanumeric and ≤10 characters, with a containment check on the written path. The parser copies part contents straight from the request bytes instead of making several whole-body copies.
- Conditional GET:
If-None-Matchhandles lists,*, and weak tags, and compares case-sensitively. - Removed Handlebars views (
.hbs) and the vendoredhandlebars-4.3.1.jar, which carried an unrelated advisory. Responsebuilds its status and MIME tables once per class instead of per request.- Behavior changes:
.hbsviews throwBoxExpress.UnsupportedViewEngine; convert them to.bxm.- Dotfiles under
boxExpressStatic()are no longer served (usedotfiles: "allow"if you relied on it). app.ws()refuses cross-site browser origins (useoriginsorapp.set("wsOrigins", "*")).- A clustered STOMP broker won't start without a 16+ character
secretKey. boxExpressCors({ credentials: true })without an explicit origin throws.trust proxy: 1(or any number) now means one hop, as in Express, not "trust everything".
- Full suite: 403/403.