stdxgit.sr.ht/~pingoo/stdx/httpx/middlewarex Index | Files

package middlewarex

import "git.sr.ht/~pingoo/stdx/httpx/middlewarex"

Index

Variables

var RequestIDCtxKey = requestIDContextKey{}

RequestIDCtxKey is the key that holds the unique request ID in a request context.

Functions

func Http3AltSvc

func Http3AltSvc(port *string) func(next http.Handler) http.Handler

func MaxBodySize

func MaxBodySize(maxSize int64) func(next http.Handler) http.Handler

func NoCache

func NoCache(next http.Handler) http.Handler

func Recoverer

func Recoverer(next http.Handler) http.Handler

func RequestID

func RequestID(header string) func(next http.Handler) http.Handler

func SetLogger

func SetLogger(logger *slog.Logger) func(next http.Handler) http.Handler

SetLogger injects `logger` in the context of requests

func SetServerHeader

func SetServerHeader(server string) func(next http.Handler) http.Handler

func StrictTransportSecurity

func StrictTransportSecurity(maxAge *string, includeSubDomains bool) func(next http.Handler) http.Handler

StrictTransportSecurity sets the Strict-Transport-Security header to maxAge if maxAge is empty, it's set to 63072000

Source Files

cache.go http3_alt_svc.go max_body_size.go recover.go request_id.go server_header.go set_logger.go strict_transport_security.go

Version
v0.0.0-20240218134121-094174641f6e (latest)
Published
Feb 18, 2024
Platform
linux/amd64
Imports
8 packages
Last checked
4 months ago

Tools for package owners.