Changelog¶
All notable changes to Marten.
[0.1.3] - 2026-01-18¶
Added¶
- Static file serving middleware -
middleware.Static()for serving static files with features: - Automatic content-type detection
- Directory index serving (index.html)
- Directory browsing (optional)
- If-Modified-Since caching support
- Directory traversal prevention
- Configurable URL prefix
- Custom 404 handlers
- HEAD request support
- 75 comprehensive test cases (325 total) covering edge cases, stress scenarios, and integration workflows
Fixed¶
- Router: Fixed wildcard routes not matching when accessed with trailing slash (e.g.,
/files/now correctly matches/files/*filepathwith empty filepath parameter) - Router: Fixed group prefix trailing slash normalization - groups created with trailing slash (e.g.,
app.Group("/api/")) now route correctly - Router: Fixed group path concatenation - paths without leading slash (e.g.,
api.GET("users", ...)) now properly combine with group prefix - Context: Fixed
Stream()panic when nil reader is provided - now handles gracefully by writing headers only - Middleware: Fixed timeout middleware race condition when handler writes response after timeout - handlers now properly check context cancellation
Improved¶
- Better path normalization in group prefixes
- More robust wildcard route matching
- Enhanced test coverage across router, context, middleware, and concurrent operations
- Added stress tests for high concurrency (1,000+ requests) and memory management (10,000+ requests)
- Added integration tests for real-world workflows (CRUD, auth, file uploads)
[0.1.2] - 2026-01-14¶
Added¶
OnStart()andOnShutdown()lifecycle hooks for AppLoggerConfig.EnableColorsfor colored terminal outputLoggerConfig.JSONFormatfor JSON-formatted logsRecoverWithConfig()with custom panic handlerRecoverWithHandler()convenience functionRecoverJSONmiddleware for JSON error responsesRateLimitConfig.OnLimitReachedfor custom rate limit responses- CORS wildcard subdomain support (e.g.,
*.example.com) Bind()now supportsapplication/x-www-form-urlencodedBind()now supportsmultipart/form-data
Fixed¶
- Context pool reset now ensures all fields are cleared between requests
Bind()now returns error for empty request bodyBind()now checks Content-Type header before parsing
Changed¶
DefaultLoggerConfig()no longer sets a default Format function
[0.1.1] - 2026-01-10¶
Added¶
HEAD()andOPTIONS()route methods on Router and GroupRoutes()method to list all registered routes for debuggingc.GetHeader()method to read request headersc.Written()method to check if response has been writtenc.HTML()method for HTML responsesc.Blob()method for binary responsesc.Stream()method for streaming responses from io.Readerc.QueryParams()method to get all query parameters as url.ValuesLoggerWithConfig()for configurable logging (custom output, format, skip)NewRateLimiter()withStop()method for proper cleanupX-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-ResetheadersRetry-Afterheader when rate limit exceededSkipoption for RateLimit and Logger middleware- CORS
ExposeHeadersandMaxAgeoptions SetTrailingSlash()for configurable trailing slash handling (Ignore, Redirect, Strict)- Route conflict detection - panics when registering conflicting param routes
Fixed¶
- Router returns 405 Method Not Allowed (with
Allowheader) instead of 404 when path exists but method doesn't match - Timeout middleware goroutine leak
- RateLimit cleanup goroutine now stoppable via
Stop()method - Compress middleware buffer flush issue
- Group middleware slice mutation
- CORS
Vary: Originheader for proper caching - ETag middleware preserves response headers
- BodyLimit handles chunked encoding (ContentLength = -1)
Changed¶
- Timeout middleware checks context cancellation properly
[0.1.0] - 2026-01-08¶
Added¶
- Core routing with radix tree
- Route groups with prefix and middleware
- Path parameters (
:id) and wildcards (*filepath) - Global and route-specific middleware
- Context with JSON/Text responses
- Response helpers:
OK(),Created(),NoContent(),BadRequest(),Unauthorized(),Forbidden(),NotFound(),ServerError() - Typed parameter helpers:
ParamInt(),ParamInt64(),QueryInt(),QueryInt64(),QueryBool() - Request helpers:
ClientIP(),Bearer(),RequestID(),IsJSON(),IsAJAX() - Request-scoped storage:
Set(),Get(),GetString(),GetInt(),GetBool() - Cookie helpers:
Cookie(),SetCookie() - Form helpers:
FormValue(),File() - Convenience types:
marten.M,marten.E() BindValid()for validation- Graceful shutdown with
RunGraceful() - 13 built-in middleware: Logger, Recover, CORS, RateLimit, BasicAuth, Timeout, Secure, BodyLimit, Compress, ETag, RequestID, NoCache