boxlang-express 0.1.15
Released .
- Fix:
req.query/req.cookiesthrew a500on a completely ordinary input — a query param or cookie with an empty key or value (?q=,?=cats,Cookie: name=,Cookie: =value).Request.bxsliced the string withleft()/right()using a count that could legitimately be0, which BoxLang throws on ("Count cannot be zero") — the exact bug classBodyParsers.bxalready guarded against, just never applied here. Along the way, found and fixed a second issue this surfaced: a failure constructingRequest/Responsewas caught silently in HttpBridge.bx — no server-side log line, and the real error message was hidden from the response even withapp.set("env", "development")on, unlike every other error path in the framework. It now logs and honorsenvthe same way route/middleware errors already do. - Fix: a
Rangerequest header of exactlybytes=(a valid header, just an empty spec) also threw a500— sameleft()/right()zero-count bug, this time in RangeParser.bx, whose own dash-split logic already usedmid()specifically to avoid it. Now falls back to a full200response, same as any other unparseableRangeheader. - Fix: a sweep of the rest of the codebase for the same
left()/right()zero-count bug turned up six more, all in Multipart.bx — the most reachable one being a plain HTML file input submitted with nothing selected (filename=""), which crashed the whole upload instead of the field simply being empty, same as it already was for a text field. Also fixed: an emptyboundary=inContent-Type, a multipart part with no headers or an empty body (a genuinely empty file/field), and a part header with an empty name or value. All converted tomid(), same fix shape asRangeParser.bxabove. - Fix: a bare
:path segment (app.get("/:", ...)) — a typo for:name— threw the sameleft()/right()zero-count error, but at route registration time rather than per-request, so it's a developer papercut rather than anything reachable by a client. Fixed the same way, but also given a properBoxExpress.InvalidRoutePathmessage (matching every sibling validation in Router.bx) instead of leaking a raw"Count cannot be zero."engine error with no indication of what was actually wrong. - Fix:
listen()created its underlyingHttpServerwith a TCP accept backlog of0(the JDK default), which turned out to be a real capacity ceiling — confirmed with a live load test (ab): request handling itself stayed fast and error-free throughout, but new connections started getting refused with a reset once concurrency passed roughly 65-70 in repeated runs.listen(port, callback, { backlog: n })now defaults to1024, which pushed the same test past 150 with no other change. See BoxExpress.bx.