cors

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllowedOrigins

func GetAllowedOrigins(corsConfig *conf.CORS) []string

GetAllowedOrigins 获取配置的允许源列表(用于日志等场景)

func IsEnabled

func IsEnabled(corsConfig *conf.CORS) bool

IsEnabled 检查 CORS 配置是否启用(用于日志等场景)

func Middleware

func Middleware(corsConfig *conf.CORS) func(http.Handler) http.Handler

Middleware 创建 CORS 中间件,直接接受 conf.CORS 配置 如果 corsConfig 为 nil 或 Enable 为 false,返回透传中间件

Types

This section is empty.

Jump to

Keyboard shortcuts

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