Repository navigation
Apion 0.2.0
A hardening release. Breaking changes — no backward compatibility with 0.1.0.
Added
- Multi-valued query and form parsing (
Map[String, Seq[String]]) withqueryParam/formFieldfirst-value accessors - Type-safe request context via
TypedKey[A]/Context, replacing the untypedMap[String, Any] - Per-server configuration via
ServerConfig(default headers, body size, read timeout);Server(config) - Route helpers
head,options,all, and single-segment*wildcard matching
Fixed
decodeURIComponentcorrupted multi-byte UTF-8 (it decoded one char per%xxbyte); now uses the JS runtime, with+-as-space handled for query/form- Request body could be re-read after
Request.copyreset its promise; the body is now memoised on the connection and consumed exactly once - Multiple
WWW-Authenticateheaders were overwritten (a typo in the multi-value header set) AuthMiddleware.excludePathsauth-bypass: matching is now segment-aware onrequest.path(wasurl.startsWith, which matched the query string and character-prefixes like/publicfooagainst/public)- Multi-segment sub-router mounts (
use("/api/v1", r)) only stripped one segment - The router froze its route table on the first request, silently ignoring later registrations
- Wildcard (
*) routes never matched (the matcher had no wildcard case)
Changed
- Default response headers are applied per-server at the send boundary rather than baked into
Responsefactories - The router is documented as the ordered pipeline it is (removed the "pre-compiled matching" framing)
Removed
Response.configure/Response.resetDefaultHeadersand the global default-header var — configure viaServerConfig- Global mutable
Request.maxBodySize/Request.bodyTimeoutvars — nowvalfallbacks; set defaults viaServerConfig InternalCompletefrom the publicResulttype (the router uses an internalOutcome)
Migration notes
request.query/request.formare nowMap[String, Seq[String]]— userequest.queryParam(name)/request.formField(name)for the first value- Middleware context: replace
request.context + ("k" -> v)withrequest.context.updated(key, v)wherekey: TypedKey[V]; read withrequest.context.get(key) - Default headers / body limits: replace
Response.configure(...)andRequest.maxBodySize = ...withServer(ServerConfig(...))
Full changelog: https://github.com/edadma/apion/blob/v0.2.0/CHANGELOG.md
204 tests, clean under -Werror.