Basic Authentication middleware for Fiber that provides an HTTP basic authentication. It calls the next handler for valid credentials and 401 Unauthorized or a custom response for missing or invalid credentials.
Cache middleware for Fiber designed to intercept responses and cache them. This middleware will cache the Body, Content-Type and StatusCode using the c.Path() as unique identifier. Special thanks to @codemicro for creating this middleware for Fiber core!
Compression middleware for Fiber that will compress the response using gzip, deflate and brotli compression depending on the Accept-Encoding header.
CORS middleware for Fiber that can be used to enable Cross-Origin Resource Sharing with various options.
CSRF middleware for Fiber that provides Cross-site request forgery protection by passing a csrf token via cookies. This cookie value will be used to compare against the client csrf token on requests, other than those defined as "safe" by RFC7231 \(GET, HEAD, OPTIONS, or TRACE\). When the csrf token is invalid, this middleware will return the fiber.ErrForbidden error. When no csrf cookie is set, or the token has expired, a new token will be generated and csrf cookie set.
The Early Data middleware for Fiber adds support for TLS 1.3's early data ("0-RTT") feature.
📄️ Encrypt Cookie
Encrypt middleware for Fiber which encrypts cookie values. Note: this middleware does not encrypt cookie names.
EnvVar middleware for Fiber that can be used to expose environment variables with various options.
ETag middleware for Fiber that lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed.
Expvar middleware for Fiber that serves via its HTTP server runtime exposed variants in the JSON format. The package is typically only imported for the side effect of registering its HTTP handlers. The handled path is /debug/vars.
Favicon middleware for Fiber that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware.
Filesystem middleware for Fiber that enables you to serve files from a directory.
Idempotency middleware for Fiber allows for fault-tolerant APIs where duplicate requests — for example due to networking issues on the client-side — do not erroneously cause the same action performed multiple times on the server-side.
Limiter middleware for Fiber used to limit repeated requests to public APIs and/or endpoints such as password reset etc. Also useful for API clients, web crawling, or other tasks that need to be throttled.
Logger middleware for Fiber that logs HTTP request/response details.
Monitor middleware for Fiber that reports server metrics, inspired by express-status-monitor
Pprof middleware for Fiber that serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool. The package is typically only imported for the side effect of registering its HTTP handlers. The handled paths all begin with /debug/pprof/.
Proxy middleware for Fiber that allows you to proxy requests to multiple servers.
Recover middleware for Fiber that recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.
RequestID middleware for Fiber that adds an indentifier to the response.
Session middleware for Fiber.
Skip middleware for Fiber that skips a wrapped handler if a predicate is true.
Timeout middleware for Fiber. As a fiber.Handler wrapper, it creates a context with context.WithTimeout and pass it in UserContext. If the context passed executions (eg. DB ops, Http calls) takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler.