middleware

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorsMiddleware

func CorsMiddleware(allowedOrigins []string, next http.Handler) http.Handler

CorsMiddleware handles CORS and OPTIONS preflight requests with optional allowedOrigins. If allowedOrigins is nil or empty, it falls back to getAllowedOrigins(). This middleware intercepts OPTIONS requests only if the Origin header is present and valid, otherwise passing the request to the router (allowing 405/404 responses as appropriate).

Types

This section is empty.

Jump to

Keyboard shortcuts

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