Skip to content

v0.4.0 — Trailing Slash Handling, SSE Flusher Fix

Latest

Choose a tag to compare

@kolkov kolkov released this 16 Jul 19:01
· 2 commits to main since this release
c4be232

What's New

Trailing Slash Handling (#6)

Configurable trailing slash behavior via WithTrailingSlash():

router := fursy.New()
router.WithTrailingSlash(fursy.StripTrailingSlash)

router.GET("/api/companies", handler)
// GET /api/companies  → 200
// GET /api/companies/ → 200 (silently stripped)

Three modes:

  • IgnoreTrailingSlash (default) — /users and /users/ are distinct routes
  • StripTrailingSlash — silently serves handler without redirect
  • RedirectTrailingSlash — 301 (GET) / 308 (other methods) redirect to canonical URL

Bidirectional matching, query string preservation, HTTP-correct redirect codes.

ResponseWriter Flusher Fix (#7)

All ResponseWriter wrappers now implement http.Flusher and Unwrap():

  • Logger, CircuitBreaker, OpenTelemetry tracing/metrics
  • SSE streaming (text/event-stream) now works correctly with middleware enabled

Code Quality

  • Resolved all 48 golangci-lint issues — 0 issues across the entire codebase
  • Test coverage: 93.8% → 94.6%

Performance

Scenario ns/op allocs/op
Exact match (trailing slash ON) 142 ns 1
Strip trailing slash (fallback) 240 ns 2
Baseline (trailing slash OFF) 131 ns 1

Near-zero overhead on exact match path.

Full Changelog: v0.3.4...v0.4.0