middleware

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: Apache-2.0 Imports: 5 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 each request's method, path, status, duration, and response size. 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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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