Skip to content
CAI
Software that uses CAICheck a score

gofiber/fiber

70.5

Strong · 13 November 2026

48.8k

lines of production code

Go

primary language

8

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add ETag middleware for HTTP caching

The new ETag middleware automatically generates strong or weak ETags for successful (200 OK) responses, enabling client-side caching via standard If-None-Match headers. It supports a configurable Weak mode, skips ETag generation for non-200 status codes, empty bodies, or existing ETags, and specifically excludes Server-Sent Events (SSE) streams to prevent buffering. The middleware also handles RFC 9110 compliant If-None-Match evaluation and prevents overflow issues on 32-bit platforms.

middleware/etag · high confidence

Add Early Data middleware with TrustProxy support

Introduces a new middleware for handling HTTP Early Data (RFC 8470) in the \middleware/earlydata\ package. The middleware checks for the \Early-Data\ header and allows requests only if the proxy is trusted (via \c.IsProxyTrusted()\) and the HTTP method is safe by default. It exposes an \IsEarly\ helper to let downstream handlers detect accepted early-data requests and stores this state using context locals. The implementation includes a configurable \Config\ struct with defaults for header names, validation logic, and error responses (defaulting to \fiber.ErrTooEarly\).

middleware/earlydata · high confidence

Add EnvVar middleware to expose specific environment variables

Introduces a new EnvVar middleware that allows applications to explicitly whitelist and expose specific environment variables as a JSON response. Users can configure the \ExportVars\ map to define which variables to include; the middleware retrieves the current value of each variable (or uses a provided default if the environment variable is not set) and returns them under a \vars\ key. It strictly supports GET and HEAD requests, returning a 405 Method Not Allowed with the appropriate Allow header for other methods, and ensures no variables are exposed if the configuration is empty to prevent accidental information disclosure.

middleware/envvar · high confidence

Add Retry addon with exponential backoff and jitter

The new Retry addon provides an exponential backoff mechanism with jitter for retrying unsuccessful network operations in Fiber applications. Users can configure parameters such as initial interval, maximum backoff time, multiplier, and maximum retry count via the \Config\ struct. The implementation ensures that no sleep occurs after the final failed attempt, optimizing latency for operations that ultimately fail. This addon is designed to be shared across concurrent callers, maintaining its own backoff state per retry invocation.

addon · high confidence

Add Server-Sent Events (SSE) middleware

Introduces a new SSE middleware for Fiber that allows applications to push real-time events to clients. The middleware handles the SSE transport layer, including setting correct response headers (Content-Type: text/event-stream), managing stream lifecycle, and detecting client disconnects via flush errors. It supports configurable heartbeats to keep idle connections alive, automatic retry intervals, and a \Handler\ function for writing events. The \Stream\ API provides methods to send data (with automatic JSON encoding for non-string types), custom event names, IDs, and comments, while ensuring thread-safety and preventing field injection by sanitizing input.

middleware/sse · high confidence

Add Skip middleware for conditional handler execution

A new Skip middleware is introduced that allows developers to conditionally bypass a specific handler in the middleware chain. By providing a predicate function, requests matching the condition will skip the wrapped handler and proceed to the next one, while non-matching requests will execute the handler. This enables more flexible request routing logic without requiring complex conditional checks inside individual handlers.

middleware/skip · high confidence

Add expvar middleware for Go runtime metrics

Introduces a new expvar middleware that exposes Go runtime statistics (such as cmdline and memstat) via the /debug/vars endpoint. The middleware handles path matching to ensure sibling routes like /debug/varsdump are not intercepted, and supports a Next function to conditionally skip the middleware.

middleware/expvar · high confidence

Add internal context value retrieval utility

A new internal package \internal/contextvalue\ has been added, providing a generic \Value\ function that retrieves values from various supported context types (including \\*fasthttp.RequestCtx\, \context.Context\, and Fiber-specific contexts). This utility standardizes how context values are accessed across the application, prioritizing standard \Value\-style lookups over Fiber-specific \Locals\ or \UserValue\ methods when multiple accessors are available.

internal/contextvalue · high confidence

Add pagination middleware with offset and cursor support

The new \middleware/paginate\ package provides a Fiber middleware that handles both offset-based and cursor-based pagination. It parses query parameters for page, limit, offset, and sort fields, enforcing configurable maximum limits and allowing users to restrict allowed sort fields via an \AllowedSorts\ whitelist. The middleware stores a \PageInfo\ object in the request context, which includes helper methods for generating next/previous page URLs and managing cursor data, while also protecting against integer overflows in start-index calculations.

middleware/paginate · high confidence

Add utility to detect typed-nil errors

A new internal utility function, IsNil, has been added to the nilerror package. This function allows callers to correctly identify when an error interface holds a nil value of a concrete type (a 'typed-nil'), which standard Go equality checks (err == nil) fail to catch. This improves error handling robustness for code that needs to distinguish between a truly nil error and one that is nil but has a non-nil type.

internal/nilerror · high confidence

Fiber v3 Helmet middleware adds comprehensive security headers and HSTS validation

The \middleware/helmet\ package has been introduced for Fiber v3, providing a security middleware that sets standard HTTP headers including XSS Protection, Content-Type Options, Frame Options, Referrer Policy, and several Cross-Origin policies (Embedder, Opener, Resource). It also supports Content-Security-Policy (with report-only mode) and Permissions-Policy. A key behavioral addition is strict validation for HSTS configuration: the middleware now panics if \HSTSMaxAge\ is negative or if \HSTSPreloadEnabled\ is set while \HSTSExcludeSubdomains\ is true, ensuring safe HSTS header generation.

middleware/helmet · high confidence

Internal memory storage implementation with context support and configurable GC

The internal storage package now includes a dedicated memory implementation (internal/storage/memory) that provides an in-memory store for testing and internal use. This implementation supports context-aware operations (GetWithContext, SetWithContext, etc.) allowing cancellation checks, and introduces a configurable garbage collection interval (defaulting to 10 seconds) to manage expired entries. It also ensures thread safety by copying keys and values during storage to prevent data races from pooled buffers, and rounds expiration durations up to whole seconds.

internal/storage · high confidence

Introduce Adaptor middleware to bridge net/http and Fiber handlers

The new \middleware/adaptor\ package enables running standard \net/http\ handlers within the Fiber framework. It implements a high-performance bridge that converts Fiber's \fasthttp\ request context to \net/http\ types and back, utilizing pooled buffers and optimized header copying to minimize allocations. The implementation includes specific optimizations for TLS connections, remote address handling, and body streaming, along with comprehensive test coverage for flushing, context propagation, and edge cases.

middleware/adaptor · high confidence

Introduce Fiber v3 Binder as a unified request binding system

Fiber v3 introduces the Binder, a new request/response binding feature that replaces the legacy parsers (BodyParser, ParamsParser, QueryParser, etc.) with a unified, extensible system. This change brings a consistent API for binding data into structs and maps, adds support for CBOR and MsgPack formats, and enables custom binder registration. The new implementation improves performance through pooled data maps and decoder caches, while also fixing several parsing edge cases such as unmatched brackets and case-insensitive content-type handling.

binder · high confidence

Introduce Idempotency Middleware

Adds a new idempotency middleware that caches HTTP responses keyed by the X-Idempotency-Key header, ensuring that repeated requests with the same key return the original response without re-executing the handler. The middleware includes a configurable lifetime (default 30 minutes), an in-memory locking mechanism to prevent race conditions, and support for custom storage and lock implementations. It also provides helper functions to determine if a response was served from the cache or stored during the current request.

middleware/idempotency · high confidence

Introduce configurable contextual logging with middleware-aware tags

The log package now supports contextual log fields that can be customized via format strings and custom tag renderers. Users can configure the default logger's context prefix using SetContextTemplate, which accepts a format string (e.g., "\[${request-id}\] ${username}") and a map of custom tag functions. Built-in tags for request ID, username, API key, CSRF token, and session ID are pre-registered to align with Fiber's standard middlewares, and the reserved ${value:KEY} tag allows reading arbitrary values from the context object. The system also includes safety features such as sanitizing control characters in log output to prevent log injection, handling typed-nil contexts gracefully, and ensuring that template rendering errors are visible in the log line rather than silently dropped. This change provides a structured way to enrich logs with request-scoped data without hardcoding field names.

log · high confidence

Introduce configurable timeout middleware with context propagation and leak prevention

Adds a new timeout middleware that enforces a configurable duration on incoming requests. The middleware wraps handlers in a goroutine and uses a timeout context, allowing handlers to detect cancellation via c.Context().Done() and return early. When a timeout occurs, it immediately returns a 408 Request Timeout (or a custom response via the new OnTimeout config option) and prevents context leaks by scheduling the race-free reclamation of the fiber.Ctx from the pool once the handler goroutine finishes. It also supports treating specific custom errors as timeouts and ensures that buffered response bodies from timed-out handlers are not leaked to the client.

middleware/timeout · high confidence

Introduce high-performance in-memory storage with defensive copying and safe TTL handling

A new internal in-memory storage implementation is added to provide a high-performance, type-safe cache for internal middleware use. The storage ensures thread safety and prevents data corruption by defensively copying string keys and byte-slice values on both set and get operations. It also introduces robust TTL handling that rounds durations up to the nearest second and saturates absolute expiries to prevent integer overflow issues, alongside a background garbage collection loop to automatically remove expired entries.

internal/memory · high confidence

Introduce new Fiber HTTP client with advanced features

The client package now provides a new, high-level HTTP client built on fasthttp, offering a chainable API for GET, POST, PUT, DELETE, and other methods. This client supports automatic JSON and XML marshaling/unmarshaling, CBOR encoding, and streaming response bodies. It includes a configurable cookie jar that adheres to RFC 6265, path parameter substitution with safe escaping, and a hook system for request and response interception. The client can be instantiated directly or wrapped around existing fasthttp.Client, HostClient, or LBClient instances, allowing for shared connection pools and TLS settings across Fiber and lower-level integrations.

client · high confidence

Introduce ordered redirect rules and fix open-redirect vulnerabilities

The redirect middleware now supports an ordered \RuleList\ configuration, allowing developers to define redirects as a slice of \Rule\ structs where the first matching rule wins, replacing the previous unordered \Rules\ map which relied on a heuristic to determine priority. This change ensures predictable redirect behavior and prevents shadowed rules from being silently ignored. Additionally, the middleware now strictly anchors patterns to the start of the path and validates target URLs to prevent open-redirect attacks, ensuring that captures cannot inject malicious authorities into the redirect location.

middleware/redirect · high confidence

New extractors package for shared value extraction

The new \extractors\ package provides shared utilities for Fiber middleware to extract string values from HTTP headers, cookies, query parameters, form data, and URL path parameters. It introduces a source-aware \Resolve\ function that returns not only the extracted value but also provenance metadata (the specific key and source type), enabling middleware to enforce security policies such as CSRF protection and authentication source validation. The package includes a \Chain\ function for fallback extraction logic, cycle detection to prevent recursive loops, and comprehensive benchmarking and fuzz testing to ensure performance and correctness.

extractors · high confidence

New header lookup API for case-insensitive and multi-value header handling

The \internal/headerlookup\ package introduces \Value\ and \Combined\ functions to safely read HTTP request headers, addressing limitations in the underlying byte-exact API. \Value\ retrieves single-value headers (like Authorization) with case-insensitive matching; it refuses to return a value if the header appears multiple times, treating such messages as malformed to prevent security issues where a later line might hide an earlier one. \Combined\ handles multi-value headers (like Accept) by joining repeated lines with a comma, while correctly preserving the semicolon separator for Cookie headers. The implementation supports both normalized and non-normalized header stores (relevant for HTTP/2 and HTTP/3) and ensures memory safety by returning copies when the \Immutable\ config option is enabled.

internal/headerlookup · high confidence

New host authorization middleware for Fiber v3

Added a new \hostauthorization\ middleware that restricts incoming requests to a configured list of allowed hosts. The middleware supports exact host matching and wildcard subdomains (e.g., \\*.example.com\), normalizes host headers by stripping ports and trailing dots, and converts Internationalized Domain Names (IDN) to Punycode. It enforces RFC 1035 length limits and rejects malformed host authorities, returning a 403 Forbidden status for unauthorized requests. Configuration allows for static allowed hosts, a dynamic validation function, and a custom error handler.

middleware/hostauthorization · high confidence

New internal TLS test helper for mutual authentication

The internal/tlstest package now provides a GetTLSConfigs function that generates paired server and client TLS configurations for testing. It creates an in-memory certificate authority and a server certificate signed by that CA, returning ready-to-use \*tls.Config objects that enforce TLS 1.2 or higher and trust each other, simplifying the setup of secure test environments.

internal/tlstest · high confidence

Security

Cache middleware rewritten with security hardening and RFC 9111 compliance

The cache middleware has been completely rewritten to address security vulnerabilities and improve standards compliance. It now includes protection against Denial of Service attacks by bounding query parameter counts (128 max) and buffer sizes (4KB max), hashing long path segments, and limiting Vary header partitions (32 max) to prevent cache explosion. Key generation has been hardened to escape delimiters and normalize method names, preventing delimiter injection. The middleware now strictly adheres to RFC 9111 for Cache-Control header parsing, including proper handling of quoted strings and directives. Additionally, it introduces a new cache key versioning system (v2) to ensure cache entries from previous versions are not misinterpreted, and adds support for the HTTP QUERY method with body-based key partitioning.

middleware/cache · high confidence

Behavioural changes

100 commits (40 fixes) modifying middleware/static

A change to existing behaviour in middleware/static — 100 commits (40 fixs), 3 files: “test: remove redundant static traversal assertion”; “polish static fs path rewrite”; “fix: address code-review findings on third-round compliance changes”; and 96 more (refs \#3834, \#3456, \#3193, \#3775, \#3101, …).

middleware/static · medium confidence · unverified

11 commits (2 fixes) modifying internal/crosshost

A change to existing behaviour in internal/crosshost — 11 commits (2 fixs), 2 files: “🧹 chore: use the shared helpers and the compact layout in the tests main added”; “🧹 chore: strip the built-in and listed headers in one pass”; “🧹 chore: trim the comments this branch adds”; and 8 more.

internal/crosshost · medium confidence · unverified

12 commits (6 fixes) modifying internal/mediatype

A change to existing behaviour in internal/mediatype — 12 commits (6 fixs), 3 files: “🧹 chore: take \[\]byte in StripParams and skip toString in Is”; “🐛 bug: align media type parsing and address review feedback”; “🧹 chore: use the shared helpers and the compact layout in the tests main added”; and 9 more.

internal/mediatype · medium confidence · unverified

13 commits (5 fixes) modifying internal/byterange

A change to existing behaviour in internal/byterange — 13 commits (5 fixs), 2 files: “🧹 chore: use the shared helpers and the compact layout in the tests main added”; “🐛 bug: fix client, session, basicauth and other bugs found in the docs audit”; “🧹 chore: fold the RFC wire tests into app\_test.go and trim comments”; and 10 more.

internal/byterange · medium confidence · unverified

18 commits (7 fixes) modifying internal/headerlist

A change to existing behaviour in internal/headerlist — 18 commits (7 fixs), 2 files: “🐛 bug: ignore empty forwarded IP elements and consolidate files”; “🐛 bug: honor quoted-pairs when HasHeaderValue splits a header list”; “chore: align forwarded header iteration”; and 15 more.

internal/headerlist · medium confidence · unverified

2 commits (0 fixes) modifying internal/fspath

A change to existing behaviour in internal/fspath — 2 commits, 2 files: “🧹 chore: move the static and SendFile path guards into internal/fspath”; “🧹 chore: deduplicate the tests of the internal packages, extractors, log and addons”.

internal/fspath · medium confidence · unverified

2 commits (0 fixes) modifying internal/storagetest

A change to existing behaviour in internal/storagetest — 2 commits, 2 files: “🧹 chore: keep a stored empty value apart from a miss in storagetest.Memory”; “🧹 chore: add the shared test helpers and document them”.

internal/storagetest · medium confidence · unverified

2 commits (0 fixes) modifying internal/testconventions

A change to existing behaviour in internal/testconventions — 2 commits, 2 files: “🧹 chore: mark the sequential tests instead of keeping a baseline file”; “🧹 chore: enforce the test conventions with an AST test”.

internal/testconventions · medium confidence · unverified

2 commits (1 fix) modifying internal/errorreplay

A change to existing behaviour in internal/errorreplay — 2 commits (1 fix), 2 files: “🧹 chore: use the shared helpers and the compact layout in the tests main added”; “🐛 bug: keep refused requests out of the cache”.

internal/errorreplay · medium confidence · unverified

226 commits (92 fixes) modifying middleware/proxy

A change to existing behaviour in middleware/proxy — 226 commits (92 fixs), 22 files: “fix(proxy): correct guard compose order and serialize installation”; “fix: Inconsistent and flaky unit-tests (\#2892)”; “fix(proxy): deepen IPv6 transition SSRF guard”; and 220 more (refs \#2892, \#3834, \#2286, \#3467, \#4405, …).

middleware/proxy · medium confidence · unverified

3 commits (0 fixes) modifying internal/redact

A change to existing behaviour in internal/redact — 3 commits, 2 files: “🧹 chore: deduplicate the tests of the internal packages, extractors, log and addons”; “refactor: harden reusable log template per multi-perspective review”; “🧹 chore: share the value-redaction helper across middleware”.

internal/redact · medium confidence · unverified

4 commits (0 fixes) modifying internal/hostname

A change to existing behaviour in internal/hostname — 4 commits, 2 files: “📒 docs: mention the Host fallback and drop the caller list from the hostname package doc”; “🧹 chore: document host helper edges and speed up the DomainForward miss”; “🧹 chore: share host splitting and IDNA folding”; and 1 more.

internal/hostname · medium confidence · unverified

4 commits (1 fix) modifying middleware/responsetime

A change to existing behaviour in middleware/responsetime — 4 commits (1 fix), 3 files: “🧹 chore: use the shared helpers and the compact layout in the tests main added”; “🔥 feat: Add response time middleware (\#3891)”; “🧹 chore: deduplicate the other middleware tests”; and 1 more (refs \#3891).

middleware/responsetime · medium confidence · unverified

4 commits (2 fixes) modifying internal/apptest

A change to existing behaviour in internal/apptest — 4 commits (2 fixs), 6 files: “🐛 bug: fix header, body, routing and session handling defects”; “🧹 chore: close the response body when apptest cannot read it”; “🧹 chore: add the shared test helpers and document them”; and 1 more.

internal/apptest · medium confidence · unverified

5 commits (1 fix) modifying internal/origin

A change to existing behaviour in internal/origin — 5 commits (1 fix), 2 files: “🧹 chore: deduplicate the tests of the internal packages, extractors, log and addons”; “🧹 chore: consolidate CORS and CSRF origin matching into internal/origin”; “🧹 chore: share origin allow-list parsing between CORS and CSRF”; and 2 more.

internal/origin · medium confidence · unverified

7 commits (1 fix) modifying internal/rulematch

A change to existing behaviour in internal/rulematch — 7 commits (1 fix), 4 files: “🧹 chore: use the shared helpers and the compact layout in the tests main added”; “🧹 chore: trim doc comments of DotSegments and route merging”; “🧹 chore: deduplicate the tests of the internal packages, extractors, log and addons”; and 4 more.

internal/rulematch · medium confidence · unverified

8 commits (2 fixes) modifying internal/sizedstream

A change to existing behaviour in internal/sizedstream — 8 commits (2 fixs), 2 files: “🧹 chore: use the shared helpers and the compact layout in the tests main added”; “🧹 chore: stop regrowing the buffer a sized stream is read into”; “🧹 chore: mark the sequential tests instead of keeping a baseline file”; and 5 more.

internal/sizedstream · medium confidence · unverified

BasicAuth middleware rewritten for v3 with hashed password support and hardened validation

The BasicAuth middleware has been completely rewritten for Fiber v3, introducing support for hashed passwords (SHA-256, SHA-512, and bcrypt) in the Users map, which are verified using constant-time comparisons to prevent timing attacks. The implementation now enforces stricter RFC 7617 compliance by validating header characters, rejecting invalid UTF-8, normalizing input to NFC, and limiting header size via a new HeaderLimit config option. It also registers a ${username} log context tag for audit logging and uses high-performance SWAR-based scanning for credential checks.

middleware/basicauth · high confidence

CORS middleware rewritten for v3 with stricter origin validation and new configuration options

The CORS middleware has been refactored for v3, introducing a new \Config\ struct that replaces positional arguments with named fields. Key behavioral changes include the addition of \AllowOriginsFunc\ for dynamic origin evaluation, \AllowPrivateNetwork\ to support the Access-Control-Allow-Private-Network header, and \DisableValueRedaction\ to control logging privacy. The middleware now strictly validates origins, rejecting those with userinfo, paths, or queries, and correctly handles the literal "null" origin string as per the CORS specification. It also preserves the original case of the Origin header in responses and includes the HTTP QUERY method in the default allowed methods list.

middleware/cors · high confidence

CSRF middleware restructured with enhanced security validation and extractor support

The CSRF middleware has been restructured to improve security and configuration flexibility. It now includes built-in validation that panics if a custom extractor is configured to read from the same cookie used for token storage, preventing accidental CSRF protection bypass. The middleware supports the new extractor pattern, allowing tokens to be retrieved from headers, forms, queries, or parameters via the \Extractor\ config option. Additionally, it introduces \TrustedOrigins\ for flexible subdomain matching, \SingleUseToken\ for rotating tokens on each request, and \DisableValueRedaction\ to control whether tokens are masked in logs. The default key generator has been updated to use \utils.SecureToken\.

middleware/csrf · high confidence

Centralized path parameter delimiter grammar

A new internal package, internal/paramdelim, has been introduced to define the set of characters that terminate a ':name' placeholder in URL paths. This change ensures that both the route parser and the HTTP client use the same grammar for delimiters (specifically '/', '-', '.', ':', '\\', and '?'), preventing them from drifting out of sync. The implementation includes a test to verify that the returned delimiter set is immutable and does not include client-only terminators like '\#'.

internal/paramdelim · high confidence

Compress middleware rewritten for Fiber v3 with zstd support and RFC-compliant encoding negotiation

The compress middleware has been completely rewritten for Fiber v3, introducing support for the zstd compression algorithm alongside existing gzip, deflate, and brotli options. The implementation now adheres to RFC 9110 standards for Accept-Encoding negotiation, correctly handling quality weights, wildcards, and header lists. It also includes improved handling of streaming responses to avoid materialization, proper ETag management for encoded bodies, and configurable compression levels (Default, BestSpeed, BestCompression, Disabled).

middleware/compress · high confidence

EncryptCookie middleware reinitialized for Fiber v3 with stricter key validation and error handling

The EncryptCookie middleware has been reinitialized for Fiber v3, introducing stricter configuration validation and improved error resilience. The middleware now enforces that the encryption key is a valid base64 string with a decoded length of exactly 16, 24, or 32 bytes, panicking at startup if these constraints are not met. During operation, it handles decryption failures by deleting invalid request cookies rather than passing them through, and ensures that response encryption errors are joined with downstream errors to prevent masking failures. The implementation also updates internal utilities to use \slices.Contains\ for exception checks and relies on \cipher.NewGCMWithRandomNonce\ for AES-GCM encryption.

middleware/encryptcookie · high confidence

Favicon middleware rewritten for Fiber v3 with new configuration options

The favicon middleware has been completely rewritten for Fiber v3, introducing a new \Config\ struct that allows users to specify a custom \FileSystem\ (supporting embedded or network filesystems via \io/fs\), set a custom \Cache-Control\ header value, provide raw favicon \Data\ directly, and enforce a \MaxBytes\ limit on the cached asset size. The middleware now defaults to serving from \/favicon.ico\, supports GET, HEAD, and OPTIONS methods, and returns 204 No Content when no favicon source is configured.

middleware/favicon · high confidence

HTTP quoted-string escaping for auth challenges

The quotedstring package now implements RFC 9110 compliant escaping for values placed inside HTTP quoted strings, specifically supporting authentication challenges. The Escape function encloses backslashes and quotes with backslash escaping, converts line breaks (LF/CR) to their backslash forms, and percent-encodes C0 control characters and DEL, while allowing non-ASCII bytes to pass through. This change ensures that internal auth challenge values are correctly formatted according to the HTTP specification.

internal/quotedstring · high confidence

Healthcheck middleware v3 with startup probe and multi-format responses

The healthcheck middleware has been migrated to v3, introducing a new StartupEndpoint (/startupz) alongside the existing liveness (/livez) and readiness (/readyz) paths to support Kubernetes startup probes. The middleware now supports configurable response formats including JSON, XML, MsgPack, and CBOR (defaulting to plain text), and ensures HEAD requests mirror the status code of GET requests as per RFC 9110.

middleware/healthcheck · high confidence

Introduce lightweight hot-path config reader to avoid struct copying

Added a new internal appconfig package that provides a zero-copy mechanism for reading specific configuration bits (Immutable, DisableHeaderNormalizing, UnescapePath) from the fiber application during request handling. This replaces the previous approach of copying the entire App.Config struct (over 600 bytes) on every call, reducing the overhead of accessing these hot-path settings from 25ns to 2ns. The implementation uses a thread-safe, once-only reader installation pattern to ensure the configuration snapshot is stable and consistent across concurrent requests.

internal/appconfig · high confidence

KeyAuth middleware refactored to use shared extractors and RFC 6750 compliance

The KeyAuth middleware has been restructured to use the shared extractor system, allowing keys to be extracted from various sources (headers, cookies, query params, etc.) via a configurable Extractor function. It now fully complies with RFC 6750 by supporting standardized error parameters (invalid\_request, invalid\_token, insufficient\_scope) and descriptions in WWW-Authenticate challenges. The middleware also integrates with the logger to automatically redact API keys in logs via a registered context tag.

middleware/keyauth · high confidence

Limiter middleware rewritten for v3 with dynamic configuration and sliding window support

The limiter middleware has been completely rewritten for v3, introducing a pluggable strategy interface that supports both Fixed Window and Sliding Window rate limiting via the new \LimiterMiddleware\ config option. Users can now dynamically control rate limits per request using the new \MaxFunc\ and \ExpirationFunc\ callbacks, and can opt out of counting specific outcomes with \SkipFailedRequests\ and \SkipSuccessfulRequests\. The middleware now supports disabling rate limit response headers via \DisableHeaders\, redacting keys in logs via \DisableValueRedaction\, and uses a shard-based locking mechanism to improve concurrency. Storage is handled via a new \fiber.Storage\ interface with \msgp\ encoding, and keys are automatically bounded to prevent storage abuse.

middleware/limiter · high confidence

Logger middleware rewritten for v3 with color support and template engine

The logger middleware has been completely refactored for v3, introducing a new template-based rendering engine (logtemplate) that replaces the previous string formatting logic. This change adds support for colored output (status codes and HTTP methods) with a new \ForceColors\ config option to override terminal detection, and introduces several predefined log formats including Common, Combined, JSON, and ECS. The middleware now supports custom context tags via \RegisterContextTag\, pre-registers known middleware tags to prevent build errors, and includes a \SanitizeValue\ helper to scrub control characters from log output, preventing log injection. The internal architecture has shifted to use compiled tag chains and a data pool for performance, while maintaining backward compatibility with the existing \Config\ structure for format, stream, and skip settings.

middleware/logger · high confidence

Optimized request-local storage for Fiber middleware

The \internal/ctxlocal\ package introduces a \Set\ function that stores request-local values more efficiently than the standard Fiber \Locals\ method. By directly invoking the underlying \Locals\ implementation on \\*fiber.DefaultCtx\ when possible, it avoids the heap allocation of the variadic slice that occurs when calling through the generic \fiber.Ctx\ interface. This change reduces allocation overhead (from 16 bytes to 0) and latency (from \~50ns to \~11ns) for middleware and extractors that store locals, while still correctly falling back to the interface method for custom context types to ensure overridden behavior is preserved.

internal/ctxlocal · high confidence

Performance optimization for same-origin checks in CSRF and redirect logic

The internal schemehost package, which validates same-origin status for CSRF (Origin/Referer) and open-redirect prevention, has been refactored to significantly improve hot-path performance. The new implementation uses allocation-free string comparisons and custom parsing for common host formats, avoiding the overhead of \url.Parse\ in the majority of cases. This change maintains strict behavioral compatibility with the previous logic, ensuring that scheme normalization (case-insensitivity) and default port handling (http:80, https:443) remain identical, while reducing memory allocations and CPU usage for these critical security checks.

internal/schemehost · high confidence

Recover middleware now supports configurable panic handling and optional stack traces

The recover middleware has been updated to allow customization of how panics are converted into errors and whether stack traces are printed. Users can now provide a custom PanicHandler to control the error message returned to the global error handler, and can enable stack trace logging via the EnableStackTrace config option, which defaults to false to avoid cluttering logs with stack dumps unless explicitly requested.

middleware/recover · high confidence

Request ID middleware now validates headers and uses SecureToken by default

The RequestID middleware has been updated to validate incoming HTTP headers, rejecting invalid characters (such as control characters) and falling back to a secure generator if the provided ID is malformed. The default generator has changed from UUIDv4 to \utils.SecureToken\ for improved privacy and security, and the middleware now automatically registers context tags for the logger middleware to include the request ID in logs.

middleware/requestid · high confidence

Rewrite middleware now supports ordered rules and anchored path matching

The rewrite middleware introduces a new \RuleList\ configuration option that accepts an ordered slice of rules, ensuring they are evaluated in the exact order specified (first match wins), replacing the previous unordered \Rules\ map which relied on a heuristic for specificity. Additionally, rewrite patterns are now anchored to the start of the request path, preventing rules from accidentally matching paths that merely contain the pattern as a suffix. The deprecated \Rules\ map is retained for backward compatibility but is discouraged in favor of the new ordered list.

middleware/rewrite · high confidence

Secure, high-performance log template engine with control-byte sanitization

The internal log template system has been replaced with a new, reusable rendering engine that parses format strings containing ${tag} and ${tag:param} placeholders into precompiled chains for efficient execution. To prevent log injection and terminal corruption, all user-controlled data written through the template is automatically sanitized, stripping ASCII control characters (such as newlines and carriage returns) while preserving tabs. The engine also provides structured error reporting via UnknownTagError, including helpful hints when a user references a bare tag that exists only in parametric form.

internal/logtemplate · high confidence

Session middleware rewritten for v3 with extractor-based ID resolution and msgp serialization

The session middleware has been completely rewritten for v3, introducing a new configuration structure and a pluggable Extractor pattern that allows session IDs to be resolved from cookies, headers, or query parameters via the extractors package. Session data is now stored in a pooled, thread-safe data structure and serialized using msgp for improved performance, while the default session key generator has been updated to use utils.SecureToken. The middleware also adds support for configurable idle and absolute timeouts, stricter cookie SameSite validation, and a new Destroy method to cleanly remove sessions.

middleware/session · high confidence

pprof middleware now supports URL prefixes and strict path matching

The pprof middleware has been refactored to support an optional URL prefix (e.g., /federated-fiber/debug/pprof) via a new Config.Prefix field, allowing it to be mounted at custom paths. Additionally, the middleware now strictly matches paths at segment boundaries to prevent accidental interception of sibling routes (such as /debug/pprofiler) and correctly handles trailing-slash redirects within the configured prefix.

middleware/pprof · high confidence

Fixes

1 commit (1 fix) fixing internal/ipv6host

A fix in internal/ipv6host — 1 commit (1 fix), 2 files: “🩹 fix: compare IPv6 hosts by address in CORS, CSRF and redirects”.

internal/ipv6host · medium confidence · unverified

31 commits (20 fixes) fixing internal/fieldname

A fix in internal/fieldname — 31 commits (20 fixs), 4 files: “🧹 chore: pin ClearTrailers' restores and note the emptied raw block”; “🐛 bug: read a response header line its own Trailer field names”; “🧹 chore: use the shared helpers and the compact layout in the tests main added”; and 28 more.

internal/fieldname · medium confidence · unverified

4 commits (3 fixes) fixing internal/bodystream

A fix in internal/bodystream — 4 commits (3 fixs), 2 files: “🐛 bug: let a later Body read a stream the handler already drained”; “🧹 chore: use the shared helpers and the compact layout in the tests main added”; “🐛 bug: keep a math.MaxInt BodyLimit from dropping streamed bodies”; and 1 more.

internal/bodystream · medium confidence · unverified

8 commits (6 fixes) fixing internal/wiretarget

A fix in internal/wiretarget — 8 commits (6 fixs), 2 files: “🐛 bug: forward the path the router matched from the proxy”; “🐛 bug: refuse proxy path parameters and stop idempotency cookie replay”; “🧹 chore: deduplicate the tests of the internal packages, extractors, log and addons”; and 5 more.

internal/wiretarget · medium confidence · unverified

Corrected HTTP ETag parsing and comparison logic

The internal ETag handling has been consolidated into a new \internal/etag\ package that strictly follows RFC 9110. This change fixes a previous bug where the ETag middleware incorrectly split header values on every comma, which caused failures when parsing opaque tags containing commas (e.g., \"v1,v2"\). The new implementation correctly distinguishes between weak and strong comparisons, properly handles the wildcard \\*\ matcher, and ensures that commas inside quoted tags are preserved rather than treated as delimiters.

internal/etag · high confidence

Prevent open redirects via URL normalization in route composition

Added an internal URL normalization package to enforce WHATWG URL parser rules before generating redirect targets. This change strips hidden control characters (tabs, newlines, carriage returns) and ensures that composed route paths always begin with exactly one forward slash, preventing attackers from using double slashes or backslashes to escape the current origin and redirect users to external domains.

internal/urlnorm · high confidence

Router keeps optional-slash routes reachable from the tree bucket

The routing engine now correctly preserves routes that end with an optional slash (e.g., \/path/\) within the tree bucket structure, ensuring they remain accessible and matchable. Previously, these routes could become unreachable or fail to match correctly during tree operations, leading to 404 errors for valid paths that relied on optional trailing slashes.

(repo-wide) · high confidence

The internal cookie package now centralizes SameSite mode parsing and formatting, ensuring consistent behavior across the framework. It supports Disabled, Lax, Strict, and None modes with case-insensitive input, and automatically enforces the Secure flag requirement for the None mode. Invalid inputs safely fall back to Lax mode, and the new logic correctly maps between Go's standard library and fasthttp cookie representations.

internal/cookie · high confidence

Test coverage

Added clocktest helper to synchronize tests with cached second-granularity clock

A new \internal/clocktest\ package provides the \SleepPast\ function, allowing tests to reliably wait for the expiration of time-to-live (TTL) values in fiber's memory storages and rate-limiters. Because these components compare expiry against a cached, second-granularity timestamp updated by a background goroutine, wall-clock sleeps alone are insufficient and can cause flaky CI failures. This helper sleeps past the TTL and then blocks until the cached timestamp has advanced, failing loudly if the clock gets stuck, ensuring deterministic test behavior.

internal/clocktest · high confidence

Dependencies

Update Go 1.26 and core dependencies in Fiber v3

The project now requires Go 1.26 and updates its core dependencies, including upgrading the HTTP engine to fasthttp v1.74.0, the schema parser to gofiber/schema v1.8.7, and the utility library to gofiber/utils/v2 v2.6.0. Additional updates include golang.org/x/crypto v0.57.0, golang.org/x/net v0.59.0, golang.org/x/text v0.42.0, and golang.org/x/sys v0.48.0, alongside updates to compression (klauspost/compress v1.20.0), CBOR (fxamacker/cbor/v2 v2.9.4), and testing libraries (stretchr/testify v1.12.1).

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 72 → 70 (-2.0)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.

Lenses

  • Code Health 73 → 73 (+0.2)
  • Architecture 75 → 84 (+9.4)
  • Maturity 70 → 75 (+4.9)
  • Readiness 81 → 80 (-0.5)
  • Security 73 → 63 (-10.0)
  • Performance 89 → 100 (+11.4)

Resolved (53)

  • App.register (cognitive 17) (router.go)
  • DefaultReq.Scheme (cognitive 24) (req.go)
  • DefaultReq.extractIPFromHeader (cyclomatic 16) (req.go)
  • DefaultReq.extractIPsFromHeader (cognitive 21) (req.go)
  • DefaultReq.extractIPsFromHeader (cyclomatic 17) (req.go)
  • Documentation: written for insiders (docs/api/app.md)
  • Duplicated block (10 lines × 2) (constraint.go)
  • Duplicated block (10 lines × 2) (middleware/cache/manager.go)
  • Duplicated block (12 lines × 3) (app.go)
  • Duplicated block (16 lines × 2) (client/request.go)
  • Duplicated block (16 lines × 2) (shared_state.go)
  • Duplicated block (18 lines × 2) (middleware/limiter/limiter_fixed.go)
  • Duplicated block (19 lines × 2) (middleware/cache/manager.go)
  • Duplicated block (26 lines × 2) (app.go)
  • Duplicated block (32–33 lines × 2) (router.go)
  • Duplicated block (6 lines × 2) (internal/tlstest/tls.go)
  • Duplicated block (6 lines × 2) (middleware/cache/manager.go)
  • Duplicated block (7 lines × 2) (req.go)
  • Duplicated block (8 lines × 2) (internal/tlstest/tls.go)
  • Duplicated block (9 lines × 2) (client/cookiejar.go)
  • …and 33 more

New (117)

  • App.processSubAppsRoutes (cyclomatic 16) (mount.go)
  • App.registerForHosts (cognitive 18) (router.go)
  • DefaultReq.FormValue (cognitive 16) (req.go)
  • Duplicated block (11 lines × 2) (constraint.go)
  • Duplicated block (16 lines × 2) (client/request.go)
  • Duplicated block (16 lines × 2) (shared_state.go)
  • Duplicated block (17 lines × 2) (internal/fieldname/fieldname.go)
  • Duplicated block (17 lines × 2) (middleware/cache/manager.go)
  • Duplicated block (19 lines × 2) (middleware/cache/manager.go)
  • Duplicated block (32–33 lines × 2) (router.go)
  • Duplicated block (8 lines × 2) (constraint.go)
  • Duplicated block (8–12 lines × 2) (middleware/cache/keygen.go)
  • Edited copies of one member (3 members, 12+ corresponding lines) (app.go)
  • Edited copies of one member (3 members, 13+ corresponding lines) (middleware/logger/utils.go)
  • Edited copies of one member (3 members, 15+ corresponding lines) (res.go)
  • Edited copies of one member (4 members, 12+ corresponding lines) (bind.go)
  • Edited copies of one member (4 members, 3+ corresponding lines) (domain.go)
  • Edited copies of one member (5 members, 11+ corresponding lines) (bind.go)
  • Edited copy of a member (10 corresponding lines) (req.go)
  • Edited copy of a member (108 corresponding lines) (middleware/limiter/limiter_fixed.go)
  • …and 97 more

Changes since last survey

  • 300 commits — 196 feature/other, 104 fixes

By area

  • (repo) — 114 commits
  • (root) — 59 commits
  • middleware/proxy — 21 commits
  • middleware/cache — 13 commits
  • middleware/session — 9 commits
  • docs/middleware — 8 commits
  • client/cookiejar.go — 6 commits
  • .github/dependabot.yml — 5 commits
  • .github/workflows — 5 commits
  • internal/headerlist — 5 commits
  • internal/sizedstream — 4 commits
  • middleware/keyauth — 4 commits
  • middleware/encryptcookie — 3 commits
  • middleware/hostauthorization — 3 commits
  • middleware/idempotency — 3 commits
  • middleware/logger — 3 commits
  • binder/binder_test.go — 2 commits
  • docs/whats_new.md — 2 commits
  • internal/apptest — 2 commits
  • internal/fieldname — 2 commits

Notable commits

  • fix: Merge branch 'main' into fix/fresh-response-status
  • fix: Merge branch 'main' into fix/hostauthorization-ipv6-canonical
  • fix: Merge branch 'main' into fix/hostauthorization-ipv6-canonical
  • fix: Merge branch 'main' into fix/hostauthorization-ipv6-canonical
  • fix: Merge branch 'main' into fix/hostauthorization-ipv6-canonical
  • fix: Merge branch 'main' into fix/keyauth-challenge-without-credentials
  • fix: Merge branch 'main' into fix/keyauth-challenge-without-credentials
  • fix: Merge pull request #4798 from kaankucukx/fix/hostauthorization-ipv6-canonical
  • fix: Merge pull request #4802 from RS-ITACHI/fix-compress-response-cache-control
  • fix: Merge pull request #4811 from Alifarid0011/fix/fresh-response-status
  • fix: Merge pull request #4819 from gofiber/fix/proxy-refused-test-key-copy
  • fix: Merge pull request #4830 from nk-batman21/fix/app-test-unknown-body-length
  • fix: Merge pull request #4832 from b84330808/fix-generic-parse-int-32bit
  • fix: Merge pull request #4834 from via2004/fix/idempotency-upstream-headers
  • fix: Merge pull request #4837 from fadiroot/fix/keyauth-challenge-without-credentials
  • fix: Merge pull request #4839 from nk-batman21/fix/app-test-tls
  • fix: Merge pull request #4840 from anqorithm/anqorithm/fix-empty-header-join
  • fix: Merge pull request #4843 from anqorithm/anqorithm/fix-cookie-jar-initialization
  • fix: Merge pull request #4856 from gofiber/fix/forwarded-header-review
  • fix: Merge pull request #4867 from Kernel-Hunter/docs/fix-dead-contrib-recipe-links
  • …and 280 more

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

gofiber/fiber was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit f9472494809345922cd513dfcd51c0396bbb8c96 — the exact code this score is about.
  • Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.61+preprod-b8b1a43ae4c3.