Skip to main content

Koa.js 3.3.0

Release Date: November 3, 2026

Koa.js 3.3.0 landed on November 3, 2026, and the headline is not a feature. It is a batch of behavior changes to request parsing and response headers that will not warn you before they break a test suite. Let's be precise about what actually changed before anyone schedules an upgrade.

The real additions

Two features are genuinely new. Koa now re-exports the http-errors utilities, so error constructors can be pulled from the framework itself instead of adding another dependency. And ctx.assert errors are now instanceof HttpError, which makes a single error-handling branch possible: previously an assertion failure and a manually thrown createError() could be told apart only by inspecting properties.

Both are additive in principle. Both change object identity in practice. If your middleware dispatches on err.name, a constructor name, or does its own instanceof checks against a different copy of http-errors, re-test the error path. Follow-up patches in this same release, #2025 and #2033, tighten prototype-based and subclass instance checks, which is a hint that the first cut had rough edges.

Response headers get stricter

The change most likely to surface as a hard failure is #2012: ctx.set() now rejects empty arrays and multiple-value arrays for singleton response headers, and normalizes one-item arrays. The validation applies to both ctx.set(name, value) and the object form ctx.set(headers). Audit any middleware that builds headers from arrays rather than setting them directly. A duplicate Content-Type or Location that slipped through before will throw now.

Two further response fixes cut both ways. #1987 makes Koa keep a Blob's own content type instead of forcing application/octet-stream, which is what you wanted, but it also means a wrong MIME type on the Blob now reaches the client instead of being masked. #1899 normalizes how the content-type value is written, so byte-exact header assertions in tests will need updating.

Request parsing changes without deprecation notices

  • #1999: request.URL now parses absolute-form request targets. Correct for proxies and CONNECT-style traffic, but anything that assumed a path-only url should be checked.
  • #2013: assigning query parameters now preserves booleans. A query string value that used to round-trip as the string "true" can now behave as a real boolean after assignment through ctx.query.
  • #2024: query parsing no longer allows prototype mutation. If any of your code relied on __proto__ passing through a query object, it is now blocked, and that is the right call.
  • #2029: X-Forwarded-Proto is lowercased in request.protocol. Comparisons against "HTTPS" break. Comparisons against "https" start working consistently behind proxies that shout.
  • #2034: IPv6 hostnames are parsed correctly from request.host. If you added a workaround for bracketed addresses, remove it or it will double-process.

What did not change

The published package still declares engines: node >= 18, even though CI was widened to Node 22 through 26. Do not read the CI matrix as a new minimum. Dependency ranges stay conservative: type-is ^2.0.1, mime-types ^3.0.1, content-disposition ~1.0.1, http-errors ^2.0.0. Much of the release is Dependabot housekeeping, including dev-dependency jumps like c8 10 to 11 and supertest 7.1.4 to 7.2.2, which affects your build only if you share those dev packages.

Verdict

Upgrade, but not blind. Run the test suite with attention to error handlers, header assertions, and proxy header handling. If your app sits behind a load balancer that sends X-Forwarded-Proto: HTTPS, grep for case-sensitive protocol checks first. The stricter singleton-header rule is the one that turns a quiet bug into a visible failure, and visible is better, as long as you find it in staging.

Other Versions

We use cookies for ads and analytics.