middleware

package
v5.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptEncodingMiddleware

func AcceptEncodingMiddleware(next http.Handler) http.Handler

AcceptEncodingMiddleware gzips 2xx response bodies for clients whose Accept-Encoding header allows it, streaming compressed bytes to the client as the handler writes. Compressed responses carry no Content-Length (the compressed size is unknown up front), so they are sent chunked. Partial content and bodies a handler already content-encoded pass through untouched. Statuses that must not carry a body (1xx, 204, 205, 304) are never compressed, and body writes on them are refused with http.ErrBodyNotAllowed.

func BasicAuthMiddleware

func BasicAuthMiddleware(login, pass string) func(next http.Handler) http.Handler

func CorsMiddleware

func CorsMiddleware(allowOrigin string) func(handler http.Handler) http.Handler

func LoggingMiddleware

func LoggingMiddleware(tpl string) func(next http.Handler) http.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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