middleware

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessLog

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

AccessLog returns middleware that logs one bounded event per request. It seeds a request_id into the context logger so all log lines within a request share a correlation field. Place inside otelhttp so trace context is available.

func CORS

func CORS(next http.Handler) http.Handler

CORS adds permissive cross-origin headers required for browser-based OAuth2 clients (e.g. the MCP Inspector). Handles OPTIONS preflight requests with a 204 short-circuit so they never reach authentication or business logic.

func SecurityHeaders added in v0.7.0

func SecurityHeaders(https bool) func(http.Handler) http.Handler

SecurityHeaders applies browser security policy to every HTTP response.

Types

This section is empty.

Jump to

Keyboard shortcuts

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