middleware

package
v0.0.0-...-d771ed5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxRequestBodySize

func MaxRequestBodySize(maxBytes int64) func(http.Handler) http.Handler

MaxRequestBodySize limits request bodies to maxBytes.

func Recovery

func Recovery(logger *slog.Logger) func(http.Handler) http.Handler

Recovery returns a middleware that recovers from panics, logs the error and stack trace, and returns a 500 response.

func RequestLogger

func RequestLogger(logger *slog.Logger) func(http.Handler) http.Handler

RequestLogger returns a middleware that logs each HTTP request using slog.

func SecurityHeaders

func SecurityHeaders(next http.Handler) http.Handler

SecurityHeaders sets defensive HTTP response headers on every response.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL